Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't set pip source on Windows #10800

Closed
1 task done
wanzzhehe opened this issue Jan 17, 2022 · 3 comments
Closed
1 task done

Can't set pip source on Windows #10800

wanzzhehe opened this issue Jan 17, 2022 · 3 comments
Labels
resolution: not a bug Determined as not a bug in pip resolution: wrong project Should be reported elsewhere

Comments

@wanzzhehe
Copy link

wanzzhehe commented Jan 17, 2022

Description

When I use python3 as microsoft store version, I can't set pip source in my computer, and it show the following message:

ERROR: Unable to save configuration. Please report this as a bug.
Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\commands\configuration.py", line 264, in _save_configuration
    self.configuration.save()
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\site-packages\pip\_internal\configuration.py", line 225, in save
    with open(fname, "w") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\\pip.ini'
ERROR: Internal Error.

so I report it.

And according to the error message, I believe that the config files should save to another place instead of the origin place.

Expected behavior

No response

pip version

pip 21.3.1

Python version

Python3.8, Python3.10

OS

Windows10 21H2

How to Reproduce

Just use python3 as microsoft store's version and run python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

Output

No response

Code of Conduct

@wanzzhehe wanzzhehe added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 17, 2022
@notatallshaw
Copy link
Contributor

notatallshaw commented Jan 17, 2022

I can reproduce but if I add the --user flag it works fine, e.g.

python3 -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple --user

This makes sense, the "pip.ini" in "Program Files" is for all users and would need admin privileges to edit, you should be writing you the user level pip configuration.

Also this isn't really a pip issue I don't think, this is a Windows permissions / Python Windows Store issue.

@wanzzhehe
Copy link
Author

OK, thanks.

@DiddiLeija
Copy link
Member

Yeah, it is known that the MStore Python can be hard to use. It is recommended to use the Python from https://python.org.

I'm closing this, since this doesn't seems to be a Pip bug.

@DiddiLeija DiddiLeija added resolution: wrong project Should be reported elsewhere resolution: not a bug Determined as not a bug in pip and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels Jan 18, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: not a bug Determined as not a bug in pip resolution: wrong project Should be reported elsewhere
Projects
None yet
Development

No branches or pull requests

3 participants