Posts: 5
Threads: 1
Joined: Apr 2019
Apr-21-2019, 04:33 AM
(This post was last modified: Apr-21-2019, 07:11 AM by Yoriz.)
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
>>>
Posts: 4,784
Threads: 76
Joined: Jan 2018
You need to type pip3 install telethon in the cmd window, not in the python shell.
Posts: 5
Threads: 1
Joined: Apr 2019
(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  right!
But which path should I pick?
Posts: 4,784
Threads: 76
Joined: Jan 2018
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.
Posts: 5
Threads: 1
Joined: Apr 2019
Apr-21-2019, 05:14 AM
(This post was last modified: Apr-21-2019, 05:15 AM by Sharon.)
(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
Posts: 4,784
Threads: 76
Joined: Jan 2018
Try python -m pip install telethon
Posts: 5
Threads: 1
Joined: Apr 2019
Apr-21-2019, 05:31 AM
(This post was last modified: Apr-21-2019, 05:31 AM by Sharon.)
(Apr-21-2019, 05:19 AM)Gribouillis Wrote: Try python -m pip install telethon
I don't think I am in the right directory...
Posts: 4,784
Threads: 76
Joined: Jan 2018
Apr-21-2019, 06:32 AM
(This post was last modified: Apr-21-2019, 06:34 AM by Gribouillis.)
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.
Posts: 7,313
Threads: 123
Joined: Sep 2016
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:\>
Posts: 5
Threads: 1
Joined: Apr 2019
(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.
|