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

PermissionError: [Errno 13] Permission denied: '/mnt/c/windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps' #8100

Closed
1 of 2 tasks
fabmeyer opened this issue Feb 27, 2022 · 3 comments

Comments

@fabmeyer
Copy link

Version

Microsoft Windows [Version 10.0.19044.1566]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu-20.04

Other Software

Visual Studio Code: Version 1.64.2
Remote Development Pack 0.21.0
Pyenv 2.2.4-1-4-g1e79a522
Pipenv 2022.1.8

Repro Steps

While trying to install all packages via pipenv install the following error appears:

fabmeyer@MININT-A6EC35R:~/Dev/Python/analytics$ pipenv install Traceback (most recent call last): File "/home/fabmeyer/.pyenv/versions/3.9.0/bin/pipenv", line 8, in <module> sys.exit(cli()) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__ return self.main(*args, **kwargs) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/cli/command.py", line 194, in install do_install( File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/core.py", line 1862, in do_install ensure_project( File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/core.py", line 526, in ensure_project ensure_virtualenv( File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/core.py", line 452, in ensure_virtualenv python = ensure_python(project, three=three, python=python) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/core.py", line 344, in ensure_python path_to_python = find_a_system_python(python) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/core.py", line 313, in find_a_system_python python_entry = find_python(finder, line) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/utils.py", line 2230, in find_python result = finder.find_python_version(line) File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 288, in find_python_version return self.system_path.find_python_version( File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 120, in system_path self._system_path = self.create_system_path() File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/pythonfinder/pythonfinder.py", line 82, in create_system_path return pyfinder_path.SystemPath.create( File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 667, in create { File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pipenv/vendor/pythonfinder/models/path.py", line 672, in <dictcomp> if p.exists() File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/pathlib.py", line 1407, in exists self.stat() File "/home/fabmeyer/.pyenv/versions/3.9.0/lib/python3.9/pathlib.py", line 1221, in stat return self._accessor.stat(self) PermissionError: [Errno 13] Permission denied: '/mnt/c/windows/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps'

This error appears when using the terminal from Ubuntu as well as from VS Code.
Pyenv works (can switch Python version, install packages and run files from VS Code).
Please help.

Expected Behavior

Should try to install all packages.

Actual Behavior

Does not install anything because of permission error (Errno 13).

Diagnostic Logs

No response

@fabmeyer
Copy link
Author

I found a workaround:
WSL : Python executable coming from outside... and failing. #3488
Using pipenv install --python=/path/to/pyenv/bin/python
Still it is not optimal and I think it should be fixed (or traceback should be improved).

@elsaco
Copy link

elsaco commented Mar 1, 2022

@fabmeyer on Ubuntu the interpreter to use is defined on the first line of pipenv:

tux@ubuntu:~$ head -1 /usr/bin/pipenv
#!/usr/bin/python3

What is the first line of your pipenv? Thx!

@OneBlue
Copy link
Collaborator

OneBlue commented Mar 1, 2022

Sadly this isn't something that WSL can fix (access to this folder being denied to program comes from Windows). Sounds like failing to access one of the folder in $PATH should be gracefully handled. In the meantime the suggested workaround appears to solve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants