Title: Python from WindowsStore: can't install package using "-m pip"
Type: behavior Stage: resolved
Components: Demos and Tools, Windows Versions: Python 3.9, Python 3.8, Python 3.7
Status: closed Resolution: duplicate
Dependencies: Superseder: Switch Windows Store package to use pip.ini for user mode
View: 37672
Assigned To: steve.dower Nosy List: Ilya Kazakevich, Marcus.Smith, dstufft, ncoghlan, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-04-04 19:57 by Ilya Kazakevich, last changed 2019-07-26 16:35 by steve.dower. This issue is now closed.

Messages (3)
msg339460 - (view) Author: Ilya Kazakevich (Ilya Kazakevich) Date: 2019-04-04 19:57
No packages could be installed with "-m pip" because of "Access Denied". It seems that it tries to install package to "site-packages' instead of "local-packages". However, "pip.exe" works. Does it mean "pip.exe" is patched somehow, but not python itself? 

c:\>"c:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\python" -m pip install flask
Collecting flask
  Using cached
Installing collected packages: flask
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\\Lib\\site-packages\\flask'
Consider using the `--user` option or check the permissions.



c:\>"c:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.1008.0_x64__qbz5n2kfra8p0\pip" install flask
Collecting flask
  Using cached
Installing collected packages: flask
  The script flask.exe is installed in 'C:\Users\SomeUser\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\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 flask-1.0.2
msg339540 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-04-06 18:03
Yeah, right now you need to also pass --local when you use -m (the bundled pip.exe does this automatically). Your user account does not have permission to install into the global site directory.

Once we update the bundled pip I can add a site-specific configuration file to handle both cases transparently (I had to enable it in pip first before we could make CPython handle it).
msg348503 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-07-26 16:35
Resolved by issue37672 (because I didn't find this issue when I was looking for it, so I created a new one)
Date User Action Args
2019-07-26 16:35:48steve.dowersetstatus: open -> closed
superseder: Switch Windows Store package to use pip.ini for user mode
messages: + msg348503

resolution: duplicate
stage: resolved
2019-04-06 18:03:38steve.dowersetversions: + Python 3.8, Python 3.9
nosy: + tim.golden, zach.ware

messages: + msg339540

assignee: steve.dower
components: + Windows
2019-04-05 19:33:28terry.reedysetnosy: + steve.dower
2019-04-04 20:45:27SilentGhostsetnosy: + paul.moore, ncoghlan, dstufft, Marcus.Smith
components: + Demos and Tools, - Installation
2019-04-04 19:57:28Ilya Kazakevichcreate