Pip not working on windows

Mike Dewhirst miked at dewhirst.com.au
Sun May 3 21:27:31 EDT 2020


On 4/05/2020 12:44 am, Aakash Jana wrote:
> I recently upgraded pip to version 20.1 and now whenever I try pup install
> on my PC I get the following error :- Fatal error in launcher : unable to
> create process using '"c:\python38\python.exe '
> "c:\Python38\Scripts\pip.exe" : The system cannot find the file specified.
> But when I manually inspected the folder 📂 the files were there I even
> tried upgrading it by python -m pip install --upgrade pip which worked but
> I still can not use pip.

Just thoughtI'd try it on my Windows PC ...

(xxex3) D:\Users\mike\envs\xxex3>pip install --upgrade -r 
requirements/test.txt
Collecting bleach
   Downloading bleach-3.1.5-py2.py3-none-any.whl (151 kB)
      |████████████████████████████████| 151 kB 2.2 MB/s
Collecting pytz
   Downloading pytz-2020.1-py2.py3-none-any.whl (510 kB)
      |████████████████████████████████| 510 kB 3.3 MB/s
Collecting requests
   Using cached requests-2.23.0-py2.py3-none-any.whl (58 kB)
Requirement already up-to-date: cirpy in 
d:\users\mike\envs\xxex3\lib\site-packages (from -r 
requirements\../ssds/requirements/base.txt (line 4)) (1.0.2)
Collecting docutils
   Using cached docutils-0.16-py2.py3-none-any.whl (548 kB)
Collecting django==2.2.12
   Using cached Django-2.2.12-py3-none-any.whl (7.5 MB)
Collecting pwned-passwords-django
   Using cached pwned_passwords_django-1.4-py3-none-any.whl (5.8 kB)
Collecting django-csp
   Downloading django_csp-3.6-py2.py3-none-any.whl (17 kB)
Collecting django-referrer-policy
   Downloading django-referrer-policy-1.0.tar.gz (3.6 kB)
Collecting stripe
   Downloading stripe-2.47.0-py2.py3-none-any.whl (203 kB)
      |████████████████████████████████| 203 kB 6.8 MB/s
Collecting coverage
   Downloading coverage-5.1-cp37-cp37m-win_amd64.whl (205 kB)
      |████████████████████████████████| 205 kB 6.4 MB/s
Processing d:\users\mike\downloads\psycopg2-2.7.7-cp37-cp37m-win_amd64.whl
Processing d:\users\mike\downloads\pillow-6.0.0-cp37-cp37m-win_amd64.whl
Collecting django-debug-toolbar
   Using cached django_debug_toolbar-2.2-py3-none-any.whl (198 kB)
Collecting packaging
   Downloading packaging-20.3-py2.py3-none-any.whl (37 kB)
Requirement already satisfied, skipping upgrade: webencodings in 
d:\users\mike\envs\xxex3\lib\site-packages (from bleach->-r 
requirements\../ssds/requirements/base.txt (line 1)) (0.5.1)
Requirement already satisfied, skipping upgrade: six>=1.9.0 in 
d:\users\mike\envs\xxex3\lib\site-packages (from bleach->-r 
requirements\../ssds/requirements/base.txt (line 1)) (1.12.0)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (2019.3.9)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (3.0.4)
Requirement already satisfied, skipping upgrade: 
urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (1.24.2)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in 
d:\users\mike\envs\xxex3\lib\site-packages (from requests->-r 
requirements\../ssds/requirements/base.txt (line 3)) (2.8)
Requirement already satisfied, skipping upgrade: sqlparse in 
d:\users\mike\envs\xxex3\lib\site-packages (from django==2.2.12->-r 
requirements\../ssds/requirements/base.txt (line 6)) (0.3.0)
Collecting pyparsing>=2.0.2
   Downloading pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
      |████████████████████████████████| 67 kB 4.5 MB/s
Installing collected packages: pyparsing, packaging, bleach, pytz, 
requests, docutils, django, pwned-passwords-django, django-csp, 
django-referrer-policy, stripe, coverage, psycopg2, Pillow, 
django-debug-toolbar
   Attempting uninstall: bleach
     Found existing installation: bleach 3.1.0
     Uninstalling bleach-3.1.0:
       Successfully uninstalled bleach-3.1.0
   Attempting uninstall: pytz
     Found existing installation: pytz 2019.1
     Uninstalling pytz-2019.1:
       Successfully uninstalled pytz-2019.1
   Attempting uninstall: requests
     Found existing installation: requests 2.21.0
     Uninstalling requests-2.21.0:
       Successfully uninstalled requests-2.21.0
   Attempting uninstall: docutils
     Found existing installation: docutils 0.14
     Uninstalling docutils-0.14:
       Successfully uninstalled docutils-0.14
   Attempting uninstall: django
     Found existing installation: Django 2.2.10
     Uninstalling Django-2.2.10:
       Successfully uninstalled Django-2.2.10
   Attempting uninstall: pwned-passwords-django
     Found existing installation: pwned-passwords-django 1.3.1
     Uninstalling pwned-passwords-django-1.3.1:
       Successfully uninstalled pwned-passwords-django-1.3.1
     Running setup.py install for django-referrer-policy ... done
   Attempting uninstall: stripe
     Found existing installation: stripe 2.29.0
     Uninstalling stripe-2.29.0:
       Successfully uninstalled stripe-2.29.0
   Attempting uninstall: coverage
     Found existing installation: coverage 4.5.3
     Uninstalling coverage-4.5.3:
       Successfully uninstalled coverage-4.5.3
   Attempting uninstall: psycopg2
     Found existing installation: psycopg2 2.8.4
     Uninstalling psycopg2-2.8.4:
       Successfully uninstalled psycopg2-2.8.4
   Attempting uninstall: Pillow
     Found existing installation: Pillow 6.0.0
     Uninstalling Pillow-6.0.0:
       Successfully uninstalled Pillow-6.0.0
Successfully installed Pillow-6.0.0 bleach-3.1.5 coverage-5.1 
django-2.2.12 django-csp-3.6 django-debug-toolbar-2.2 
django-referrer-policy-1.0 docutils-0.16 packaging-20.3 psycopg2-2.7.7 
pwned-passwords-django-1.4 pyparsing-2.4.7 pytz-2020.1 requests-2.23.0 
stripe-2.47.0

WARNING: You are using pip version 20.0.2; however, version 20.1 is 
available.
You should consider upgrading via the 
'd:\users\mike\envs\xxex3\scripts\python.exe -m pip install --upgrade 
pip' command.

(xxex3) D:\Users\mike\envs\xxex3>pip install --upgrade pip
Collecting pip
   Downloading pip-20.1-py2.py3-none-any.whl (1.5 MB)
      |████████████████████████████████| 1.5 MB 1.7 MB/s
Installing collected packages: pip
   Attempting uninstall: pip
     Found existing installation: pip 20.0.2
     Uninstalling pip-20.0.2:
       Successfully uninstalled pip-20.0.2
ERROR: Could not install packages due to an EnvironmentError: [WinError 
5] Access is denied: 
'D:\\users\\mike\\temp\\pip-uninstall-b1k082p9\\pip.exe'
Consider using the `--user` option or check the permissions.

# so I tried again using the advice a few lines above in the WARNING and ...

(xxex3) 
D:\Users\mike\envs\xxex3>d:\users\mike\envs\xxex3\scripts\python.exe -m 
pip install --upgrade pip
Requirement already up-to-date: pip in 
d:\users\mike\envs\xxex3\lib\site-packages (20.1)
Could not build wheels for pip, since package 'wheel' is not installed.

(xxex3) D:\Users\mike\envs\xxex3>

Which all means there are problems with pip on Windows if you don't 
follow the documented advice very carefully. The reason is that Windows 
is not designed for developers and pip has to turn itself inside out for 
Windows compared with Linux pip.

Just in case you didn't notice, I did all the above in a virtualenv. 
Here is the base Python pip ...

C:\Python36>python.exe -m pip install --upgrade pip
Collecting pip
   Using cached 
https://files.pythonhosted.org/packages/54/2e/df11ea7e23e7e761d484ed3740285a34e38548cf2bad2bed3dd5768ec8b9/pip-20.1-py2.py3-none-any.whl
packaging 19.0 requires six, which is not installed.
mike 0.3.5 requires six, which is not installed.
livereload 2.6.0 requires six, which is not installed.
Installing collected packages: pip
   Found existing installation: pip 10.0.1
     Uninstalling pip-10.0.1:
       Successfully uninstalled pip-10.0.1
Successfully installed pip-20.1


So I had better install six ... but to use the correct pip and python I 
need to be specific ...


C:\Python36>dir scripts
  Volume in drive C is OS
  Volume Serial Number is 1CCB-177E

  Directory of C:\Python36\scripts

04/05/2020  11:16 AM    <DIR>          .
04/05/2020  11:16 AM    <DIR>          ..
04/12/2019  05:16 PM           102,761 easy_install-3.6.exe
04/12/2019  05:16 PM           102,761 easy_install.exe
04/05/2020  11:16 AM           106,336 pip.exe
04/05/2020  11:16 AM           106,336 pip3.6.exe
04/05/2020  11:16 AM           106,336 pip3.exe
                5 File(s)        524,530 bytes
                2 Dir(s)  69,478,674,432 bytes free

C:\Python36>cd ..

C:\>python36\scripts\pip install six
Collecting six
   Using cached six-1.14.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: six
Successfully installed six-1.14.0

C:\>


I have to use Python36 because that is the version supplied in Ubuntu 
18.04 which I use for our production server.

It does work and you should understand that Microsoft does not go out of 
its way to make things easy for anyone who doesn't do things their way.

Cheers

Mike



More information about the Python-list mailing list