Permission Denied - Virtual Environment create
Hi everyone,
i want to create a Virtual Environment in Pycharm but it fails.

The project is checked out from git and all permissions are appropriate.
The log tells me:
2022-02-14 22:25:18,836 [3335899] INFO - packaging.PyPackageManagerImpl - Traceback (most recent call last):
File "/usr/lib/pypy3.8/runpy.py", line 198, in _run_module_as_main
"__main__", mod_spec)
File "/usr/lib/pypy3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/__main__.py", line 168, in <module>
run()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/__main__.py", line 164, in run
run_virtualenv()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/__main__.py", line 18, in run
session = cli_run(args, options, env)
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/run/__init__.py", line 32, in cli_run
of_session.run()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/run/session.py", line 46, in run
self._create()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/run/session.py", line 53, in _create
self.creator.run()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/create/creator.py", line 171, in run
self.create()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/create/via_global_ref/builtin/via_global_self_do.py", line 101, in create
super(ViaGlobalRefVirtualenvBuiltin, self).create()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/create/via_global_ref/api.py", line 89, in create
self.install_patch()
File "/home/user/.local/share/JetBrains/Toolbox/apps/PyCharm-P/ch-0/213.5744.248/plugins/python/helpers/virtualenv.pyz/virtualenv/create/via_global_ref/api.py", line 96, in install_patch
pth.write_text("import _virtualenv")
File "/usr/lib/pypy3.8/pathlib.py", line 1255, in write_text
with self.open(mode='w', encoding=encoding, errors=errors) as f:
File "/usr/lib/pypy3.8/pathlib.py", line 1223, in open
opener=self._opener)
File "/usr/lib/pypy3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
PermissionError: [Errno 13] Permission denied: PosixPath('/home/user/project/venv/lib/pypy3.8/site-packages/_virtualenv.pth')
So it complains about the permission on the project directory, but as i said, everything i right. I have full write permission.
Im running PyCharm on Gentoo Linux

Any hints?
Thanks
请先登录再写评论。
Hi, could you please test if PyCharm can access the file, e.g. by running in the terminal:
cat /home/user/project/venv/lib/pypy3.8/site-packages/_virtualenv.pthAlso, what is the base interpreter path you're using? Are you able to create virtualenv for this interpreter from the terminal outside of the IDE?
Hi.
the file doesn't exist if i try to create the virtualenv with PyCharm.
The base interpreter is pypy
If i manually create the virtualenv everything is fine and the app starts as expected.
After manually creating the virtualenv, please try adding it to PyCharm as an existing virtualenv environment. Does it work?
Yes it does.
Any Ideas why PyCharm isn't able to create a virtualenv?
Please add the following lines to **Help | Diagnostic Tools | Debug Log Settings...**:
```
#com.intellij.execution.configurations.GeneralCommandLine
```
(keep the # character)
Then, please submit an issue to https://youtrack.jetbrains.com/issues/py and attach Logs from **Help | Collect Logs and Diagnostic Data** after reproducing the issue.