Python Forum

Full Version: How to install Telethon?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, please be kind because I feel dumb. It's my first day using Python and I'm trying to install Telethon.

This machine is an old WIN7 and I just installed the last Python version (3.7.3) then I opened the Python shell and tried the following:

Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> pip3 install telethon
SyntaxError: invalid syntax
>>> help
Type help() for interactive help, or help(object) for help about object.
>>> python pip install telethon
SyntaxError: invalid syntax
>>> install telethon
SyntaxError: invalid syntax
>>>
You need to type pip3 install telethon in the cmd window, not in the python shell.
(Apr-21-2019, 04:41 AM)Gribouillis Wrote: [ -> ]You need to type pip3 install telethon in the cmd window, not in the python shell.

ahhhhhh Blush right!

But which path should I pick?

[Image: Xd8CCivl.jpg]
Normally, you don't need to worry about sys.path. Simply try
>>> import telethon
in the python shell to see if the install succeeded. If it doesn't raise an error, it should be ok.
(Apr-21-2019, 05:04 AM)Gribouillis Wrote: [ -> ]Normally, you don't need to worry about sys.path. Simply try
>>> import telethon
in the python shell to see if the install succeeded. If it doesn't raise an error, it should be ok.

I meant the path in the CMD otherwise it's not installing Cry

[Image: 0ZSSR78l.jpg]
Try python -m pip install telethon
(Apr-21-2019, 05:19 AM)Gribouillis Wrote: [ -> ]Try python -m pip install telethon

I don't think I am in the right directory... Undecided

[Image: kNxSf0Z.jpg]
I'm usually not a windows user but I think you can use the python launcher py instead of python. Alternately you can add C:\Program Files\Python 3.7 to the PATH environment variable (if your python is 3.7). This has nothing to do with sys.path which is the path used internally by python to discover installed modules.
Look at Python 3.6/3.7 and pip installation under Windows
There also a part there Fixing Path if needed .

When have done that it will work like this from cmd.
# Test python
C:\>python -V
Python 3.7.3

# Test pip
C:\>pip -V
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)

# Install
C:\>pip install telethon
Collecting telethon
  Downloading ...........
Installing collected packages: pyaes, rsa, telethon
Successfully installed pyaes-1.6.1 rsa-4.0 telethon-1.6.2

# Test that it work
C:\>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import telethon
>>> telethon.__version__
'1.6.2'
>>> exit()

C:\>
(Apr-21-2019, 07:11 AM)snippsat Wrote: [ -> ]Look at Python 3.6/3.7 and pip installation under Windows
There also a part there Fixing Path if needed .

When have done that it will work like this from cmd.
# Test python
C:\>python -V
Python 3.7.3

# Test pip
C:\>pip -V
pip 19.0.3 from c:\python37\lib\site-packages\pip (python 3.7)

# Install
C:\>pip install telethon
Collecting telethon
  Downloading ...........
Installing collected packages: pyaes, rsa, telethon
Successfully installed pyaes-1.6.1 rsa-4.0 telethon-1.6.2

# Test that it work
C:\>python
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import telethon
>>> telethon.__version__
'1.6.2'
>>> exit()

C:\>


Thanks all, I solved the issue by reinstalling it and checking the damn box add to path at the start of the installation which I did not see the first time.