Python Forum
Python 3.9/3.8 and pip installation under Windows - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: Tutorials (https://python-forum.io/forum-4.html)
+---- Forum: Python Installation and Execution (https://python-forum.io/forum-41.html)
+---- Thread: Python 3.9/3.8 and pip installation under Windows (/thread-3258.html)



Python 3.9/3.8 and pip installation under Windows - snippsat - May-09-2017

Python 3.9.1
Installer is the same as before,here some points
[Image: 7U9xPW.png]
Start cmd and test that python and pip point to Python 3.9 from any folder.
Microsoft Windows [Version 10.0.19041.804]
(c) 2020 Microsoft Corporation. Med enerett.
C:\Users\Tom>cd ..
C:\Users>cd ..

# Test python
C:\>python -V
Python 3.9.1

# Test pip
C:\>pip -V
pip 20.2.4 from c:\python39\lib\site-packages\pip (python 3.9)
As what show over works,can now run code from any folder.
# answer.py
def universe():
    return 42

print(f'The answer to everything is {universe()}')
From cmd.
Output:
# Go to folder where code is C:\>cd code # Run code C:\code>python answer.py The answer to everything is 42

Fixing Path if needed
If you have installed Python before,then may need to manually update Environment Variables Path.
Here how to change Environment Variables Path
Same as image but point to where you have installed Python 3.9.
[Image: WfreEG.png]
Test python and pip again same as posted over.



Python 3.8.5

The installer(since 3.6) is the same for 3.8,here a image with some advice.
[Image: 3.8.png]

Check Windows Path that python and pip work from anywhere in cmd
# Test pip
C:\>pip -V
pip 19.2.3 from c:\python38\lib\site-packages\pip (python 3.8)

# Test Python
C:\Python38>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(walrus := True)
True
>>>
>>> a = 11
>>> if (b := a) > 10:
...     print(f'The value of b is {b} and greater than 10')
...
The value of b is 11 and greater than 10

>>> exit()
Dos not Windows Path work like this,look at Environment Variables Path,and change to 3.8 location on disk.

Install with pip is the same.
# Install eg Requests
C:\>pip install requests
Collecting requests .....
Successfully installed requests-2.22.0

# Test that Requests work
C:\>python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>>
>>> r = requests.get('http://python-forum.io')
>>> r.status_code
200
>>> r.headers['Date']
'Sat, 08 Feb 2020 19:42:48 GMT'
>>> exit()


Python 3.7 install last in this thread.

This is a advice how to install Python and pip under Windows | Part-2
It's advisable to change the long default Path,to a simper Path eg C:\Python36.

Python download.
Choose a executable installer  32-bit or 64-bit.

[Image: 4Qfi5o.jpg]


Under Customize installation make sure that pip is marked on.

[Image: O0ydCp.jpg]


Here also choose Path C:\Python36

[Image: anUIAI.jpg]


Finish install.

[Image: tlZRit.jpg]

Restart

Testing that python and pip command work from cmd.
Start cmd:

Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. Med enerett.
   
C:\Windows\System32>cd\
   
C:\>python
Python 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 07:18:10) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
   
C:\>pip -V
pip 9.0.1 from c:\python36\lib\site-packages (python 3.6)
C:\>
Now that all work,can eg test pip with install of Requests.
C:\>pip install requests
Collecting requests
  Using cached requests-2.13.0-py2.py3-none-any.whl
Installing collected packages: requests
Successfully installed requests-2.13.0

C:\>python
Python 3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 17:54:52) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
>>> r = requests.get('https://www.python.org/')
>>> r.status_code
200
>>> r.encoding
'utf-8'
>>> r.headers['date']
'Tue, 09 May 2017 15:34:57 GMT'



RE: Python 3.6 and pip installation under Windows - metulburr - May-16-2017

Would like to add some things.


A lot of people come unfamiliar with using the command prompt and are confused in thinking pip is ran on the python interpreter (ie. >>> prompt), but is ran on the system's command prompt (ie. windows C:\ prompt, linux username@computername ~$).


Also your pip may be out of date.

Quote:pip : You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
This is just a warning. Your package will still install, but it is just warning you that your pip is not current. You can update pip by the command they give you pip install --upgrade pip


You can use pip to upgrade your existing packages
pip install -U youtube-dl



RE: [Part-1]Python 3.6 and pip installation under Windows - snippsat - Jun-29-2018

Python 3.7
Installasjon work the same 3.6.
But the Add Python 3.7 to Path did not overwrite the 3.6 Path,so i had to change Path manually to point to 3.7.
The setup look:
[Image: FNhk69.jpg]
pip is automatically marked on,do not utmark it.

Fixing Path if needed
For new user the Path to 3.7 should be okay.
Here how to change Environment Variables Path
[Image: GUgLry.jpg]

Check python and pip
Check that python and pip point to 3.7 from anywhere cmd/cmder.
C:\
λ python -V
Python 3.7.0

C:\
λ pip -V
pip 10.0.1 from c:\python37\lib\site-packages\pip (python 3.7)
python my_scrip.py will use Python 3.7.
pip install something will install to Python 3.7

Access other versions
All other version installed can be accessed by using py(this is a py.exe that get installed in Path of Windows)
C:\                                                                                                            
λ py -3.6 -V                                                                                                   
Python 3.6.4                                                        
                                                     
C:\                                                                                                            
λ py -2.7 -V                                                                                                   
Python 2.7.9                                                                                                   
                                                                                                               
C:\                                                                                                            
λ # Using pip to install to 2.7                                                                            
λ py -2.7 -m pip install logzero                                                                               
Requirement already satisfied: logzero in c:\python27\lib\site-packages 



RE: [Part-1]Python 3.6 --> 3.8 and pip installation under Windows - snippsat - Feb-08-2020

Added info about Python 3.8 at top.


RE: Python 3.8 (3.6-3.7) and pip installation under Windows - snippsat - Feb-17-2021

Added info about Python 3.9 at top.