Skip to content

pip config failed to write pip.ini when using MS Store py #13292

Open
@imba-tjd

Description

@imba-tjd

Description

Some locations are readonly when py is installed via MS Store.

I searched issues and there was one essentially reporting the same error just like what I'm encountering.
#11920

Expected behavior

Write to Appdata.

Or abort the action but show a graceful message to the user.

pip version

25.0.1

Python version

3.11

OS

Win11 24H2

How to Reproduce

  1. install python from ms store
  2. pip config set global.index-url xxx

Output

C:\Users\xxx>pip config set global.index-url xxx
Writing to C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\pip.ini
ERROR: Unable to save configuration. Please report this as a bug.
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_internal\configuration.py", line 215, in save
    with open(fname, "w") as f:
         ^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\\pip.ini'
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
  File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_internal\commands\configuration.py", line 265, in _save_configuration
    self.configuration.save()
  File "C:\Users\xxx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pip\_internal\configuration.py", line 218, in save
    raise ConfigurationError(
pip._internal.exceptions.ConfigurationError: An error occurred while writing to the configuration file C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\pip.ini: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_3.11.2544.0_x64__qbz5n2kfra8p0\\pip.ini'
ERROR: Internal Error.

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions