mozilla/iris

Windows 10 bootstrap fails to install pipenv

Closed this issue · 6 comments

When trying to bootstrap on Windows 10 I get the following error:

  --->   installing/updating Python 3.7 #####
  --->   Update to Python 3.7 .
  --->   installing/upgrading pipenv

pip3.7 : The term 'pip3.7' is not recognized as the name of a cmdlet, function, script file, or 
operable program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At line:1 char:1
+ pip3.7 install pipenv
+ ~~~~~~
     + CategoryInfo          : ObjectNotFound: (pip3.7:String) [], CommandNotFoundException
     + FullyQualifiedErrorId : CommandNotFoundException

Bootstrap finishes but I cannot successfully run pipenv install afterwards.

Running pip --version afterwards returns:
pip 19.2.3 from c:\users\iris\scoop\apps\python\3.8.0\lib\site-packages\pip (python 3.8)

Running pip install pipenv results in:

Collecting pipenv
  Downloading https://files.pythonhosted.org/packages/13/b4/3ffa55f77161cff9a5220f162670f7c5eb00df52e00939e203f601b0f579/pipenv-2018.11.26-py3-none-any.whl (5.2MB)
     |████████████████████████████████| 5.2MB 6.4MB/s
Requirement already satisfied: pip>=9.0.1 in c:\users\iris\scoop\apps\python\3.8.0\lib\site-packages (from pipenv) (19.2.3)
Collecting virtualenv (from pipenv)
  Downloading https://files.pythonhosted.org/packages/c5/97/00dd42a0fc41e9016b23f07ec7f657f636cb672fad9cf72b80f8f65c6a46/virtualenv-16.7.7-py2.py3-none-any.whl (3.4MB)
     |████████████████████████████████| 3.4MB 6.4MB/s
Collecting certifi (from pipenv)
  Downloading https://files.pythonhosted.org/packages/18/b0/8146a4f8dd402f60744fa380bc73ca47303cccf8b9190fd16a827281eac2/certifi-2019.9.11-py2.py3-none-any.whl (154kB)
     |████████████████████████████████| 163kB ...
Requirement already satisfied: setuptools>=36.2.1 in c:\users\iris\scoop\apps\python\3.8.0\lib\site-packages (from pipenv) (41.2.0)
Collecting virtualenv-clone>=0.2.5 (from pipenv)
  Downloading https://files.pythonhosted.org/packages/ba/f8/50c2b7dbc99e05fce5e5b9d9a31f37c988c99acd4e8dedd720b7b8d4011d/virtualenv_clone-0.5.3-py2.py3-none-any.whl
Installing collected packages: virtualenv, certifi, virtualenv-clone, pipenv
  WARNING: The script virtualenv.exe is installed in 'c:\users\iris\scoop\apps\python\3.8.0\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script virtualenv-clone.exe is installed in 'c:\users\iris\scoop\apps\python\3.8.0\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts pipenv-resolver.exe and pipenv.exe are installed in 'c:\users\iris\scoop\apps\python\3.8.0\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed certifi-2019.9.11 pipenv-2018.11.26 virtualenv-16.7.7 virtualenv-clone-0.5.3
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Following which I can then run pipenv install which results in:

Warning: Python 3.7 was not found on your system…
You can specify specific versions of Python with:
  $ pipenv --python path\to\python

Note, the following is my System PATH variable:
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;%SYSTEMROOT%\System32\OpenSSH\;C:\Program Files\Git\cmd

and the following is my User PATH variable:
C:\Users\iris\scoop\apps\python\current;C:\Users\iris\scoop\apps\python\current\Scripts;C:\Users\iris\scoop\shims;C:\Users\iris\AppData\Local\Microsoft\WindowsApps

@ashughes1 that's weird that it says python3.7 is not installed... can you check which versions of python are on your machine?

have you tried running python3.7 -m pip commands instead?

oh.... your traceback shows python3.8

oh.... your traceback shows python3.8

Yes, despite the Boostrap showing it was installing Python 3.7 it looks like Python 3.8 was installed.

I uninstalled everything scoop installed with scoop uninstall scoop then changed the bootstrap command to install python from scoop install python to scoop install python37 which installs python 3.7.5 but I still don't get pip3.7 installed. In fact no version of pip is installed this way.

Pull request #628 seems to have resolved this on my end. This likely needs to be upstreamed to Iris Core.

I was also facing a similar issue in Windows 10:

image

This problem was occurring because, in the windows machine, there is a default folder called "WindowsApps", in which there are two ".exe" files with the name "python.exe" and "python3.exe" which are nothing but an executable link to download python 2 and python 3 respectively from the windows app store. So whenever win_botstrap.sh file was trying to execute "if [[ $(python3 --version | grep "Python 3.7") =~ 3.7 ]]; " at line number 100, it was throwing "Permission denied" error for python.

Since python was not getting installed in scoop hence system was unable to run the "pip3.7 install pipenv" command as pip is a package management system used to install and manage software packages written in Python.

The issue got resolved when i deleted these two files (python.exe an python3.exe) from given folder:
/c/Users/USERNAME/AppData/Local/Microsoft/WindowsApps/

It worked for me after that.

This problem was occurring because, in the windows machine, there is a default folder called "WindowsApps", in which there are two ".exe" files with the name "python.exe" and "python3.exe" which are nothing but an executable link to download python 2 and python 3 respectively from the windows app store. So whenever win_botstrap.sh file was trying to execute "if [[ $(python3 --version | grep "Python 3.7") =~ 3.7 ]]; " at line number 100, it was throwing "Permission denied" error for python.

Since python was not getting installed in scoop hence system was unable to run the "pip3.7 install pipenv" command as pip is a package management system used to install and manage software packages written in Python.

You were seeing the same symptom but it is not the same problem I was facing. Thanks.