Configure python interpreter for a project on WSL ubuntu.
For the life of me, and Claude, and ChatGpt,… I am not able to get pycharm to interpret my python code installed on WSL subsystem on my pc. Here is what I did
- Installed python3.9 on WSL
- Create a project with virtual environment using python 3.9
- Create a project in pycharm pointing to project root
- Goto settings/python interpreter. Add a new interpreter:
select existing environment
select Interpreter from the direvctory list (project root/venv/bin/python3.9).
Click OK.
Get nonzero exit code (2):
python3.9: can't open file ‘/root/.pycharm_helpers/packaging_tool.py’: [errno 13] Permission denied>
My wsl subsystem doesn't have root account and packaging_tool.py doesn't exist.
How do I get around this?
Please sign in to leave a comment.
Hi Cpeters5 , the error looks like some permissions isue. Would it work if you re-create WSL interpreter from scratch directly from the IDE?
For better understanding of this behavior, please share logs from Help | Collect Logs and Diagnostic Data after reproducing it. Please upload it to https://uploads.services.jetbrains.com and let me know the upload ID.
Thank you Mikhail. There were other issues with WSL subsystem on the PC (mac seems to work fine). So I decided to remove it and just use the windows OS. No problem there! Thank you for your help.
pac