Why is windows forcing --user flag in pip?

265 views Asked by At

I'm unable to use pdm in windows because windows has a pip.ini file in a protected folder (C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0):

[install]
user=yes
[uninstall]
user=yes
[freeze]
user=yes
[list]
user=yes

This file is not modifiable even with admin powershell in windows 11. I also cannot overwrite the values, since that version seems to be the most powerful value:

$ pip config -v list                                                                                               
For variant 'global', will try loading 'C:\ProgramData\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\<username>\pip\pip.ini'
For variant 'user', will try loading 'C:\Users\<username>\AppData\Roaming\pip\pip.ini'
For variant 'site', will try loading 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\pip.ini'
freeze.user='yes'
install.user='yes'
list.user='yes'
uninstall.user='yes'

This causes a failure when using pdm:

$ py.exe -m pdm install -v
Preparing isolated env for PEP 517 build...
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

which prevents me from installing packages correctly.

Have I installed pdm, pip or python incorrectly?

0

There are 0 answers