mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-16 06:26:37 +03:00
60 lines
2.0 KiB
ReStructuredText
60 lines
2.0 KiB
ReStructuredText
Installation
|
|
============
|
|
|
|
Telethon is a Python 3 library, which means you need to download and install Python to use it.
|
|
Installing Python, using virtual environments, and the basics of the language, are outside of the scope of this guide.
|
|
|
|
You can find the official resources to `download Python <https://www.python.org/downloads/>`_,
|
|
learn about the `Python Setup and Usage <https://docs.python.org/3/using/index.html>`_ for different platforms,
|
|
or follow the `The Python Tutorial <https://docs.python.org/3/tutorial/index.html>`_ to learn the basics.
|
|
These are not necessarily the best resources to learn, but they are official.
|
|
Be sure to search online if you prefer learning in video form or otherwise.
|
|
|
|
You can confirm that you have Python installed with:
|
|
|
|
.. code-block:: shell
|
|
|
|
python --version
|
|
|
|
Which should print something similar to ``Python 3.11.5`` (or newer).
|
|
|
|
|
|
Installing the latest stable version
|
|
------------------------------------
|
|
|
|
Once you have a working Python 3 installation, you can install or upgrade the ``telethon`` package with ``pip``:
|
|
|
|
.. code-block:: shell
|
|
|
|
python -m pip install --upgrade telethon
|
|
|
|
Be sure to use lock-files if your project depends on a specific, older version of the library!
|
|
|
|
|
|
Installing development versions
|
|
-------------------------------
|
|
|
|
If you want the *latest* unreleased changes, you can run the following command instead:
|
|
|
|
.. code-block:: shell
|
|
|
|
python -m pip install --upgrade https://github.com/LonamiWebs/Telethon/archive/v2.zip
|
|
|
|
.. note::
|
|
|
|
The development version may have bugs and is not recommended for production use.
|
|
However, when you are `reporting a library bug <https://github.com/LonamiWebs/Telethon/issues/>`,
|
|
you must reproduce the issue in this version before reporting the problem.
|
|
|
|
|
|
Verifying the installation
|
|
--------------------------
|
|
|
|
To verify that the library is installed correctly, run the following command:
|
|
|
|
.. code-block:: shell
|
|
|
|
python -c "import telethon; print(telethon.__version__)"
|
|
|
|
The version number of the library should show in the output.
|