Score:0

WSL on win11 - Permission denied running python script

cw flag

I am trying to run a python script that creates a file. when running I get :

File "/home/ashi/.pyenv/versions/3.8.5/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied:"/Users"

I'm running Ubuntu 20.04 using WSL on win11. I installed python using pyenv. I have tried all the chmod commands, and tried from root user.

Thanks

muru avatar
us flag
`/Users`? Sounds like a macOS path. What frankensystem are you using that uses macOS paths in a Linux subsystem in Windows?
Ashi234 avatar
cw flag
I have no idea. The only things I installed are pyenv - python 3.8.5, poetry - poetry install.
muru avatar
us flag
What's the actual command you're running that causes this problem? Is this script written by you or someone else?
Ashi234 avatar
cw flag
The command I'm running is: python -m unittest test.test_contract
Ashi234 avatar
cw flag
It wasn't written by me
Ashi234 avatar
cw flag
Thanks guys! In the end it was caused because of one of the env variables.
NotTheDr01ds avatar
vn flag
@Ashi234 Good to hear you got it figured out. It might be something that someone else will come across in the future, so it would be great if you could provide the details in an answer, then self-accept it. This will also "close out" the question. Thanks!
Score:0
cw flag

Solved! The problem was caused by an environment variable loaded from my .envrc file. To solve the problem I just created the dir that the program was expecting to see.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.