[Python] wsl: Permission denied on using pyenv

Discussão em 'Python' iniciado por Stack, Novembro 26, 2025.

  1. Stack

    Stack Membro Participativo

    Problem


    I recently installed pyenv on wsl(24.04) and tried to set python version on local directory, but I got this error:

    $ pyenv local 3.14.0
    ~/.pyenv/libexec/pyenv-version-file-write: line 37: .python-version: Permission denied


    the line 37 is like this:

    > "$PYENV_VERSION_FILE"
    for version in "${versions[@]}"; do
    echo "$version" >> "$PYENV_VERSION_FILE"
    done
    "~/.pyenv/libexec/pyenv-version-file-write" 40L, 851B


    Also, I got another error when I use venv:

    ~/mypython$ python -m venv test
    Error: [Errno 13] Permission denied: ' ~/mypython/test'


    I don't have "test" folder on my current directory:

    ~/mypython$ ls
    ~/mypython$

    What I tried


    I deleted .pyenv folder and re-installed it but the situation didn't change.

    Continue reading...

Compartilhe esta Página