pyenv-win cannot escape properly

Asked 2 years ago, Updated 2 years ago, 169 views

env

  • Windows 10
  • fish
  • ssh on msys2
  • Username has white blank
  • I change home directory from msys2 default home directory (/c/msys64/home/{User name}) to "/c/Users/{User name}" on both local setting and ssh setting.

bug

>pyenv --version
   The system cannot find the file specified.
   pyenv2.64.6.1

>pyenv versions
   * 3.9.0

>python-V
   "{Username former part}" is not recognized as an internal or external command,
   operable program or batch file.

>"/c/Users/User name/.pyenv/pyenv-win/shims/python" - V
   "{Username former part}" is not recognized as an internal or external command,
   operable program or batch file.

> which python
   "/c/Users/User name/.pyenv/pyenv-win/shims/python"

>which pyenv
   "/c/Users/User name/.pyenv/pyenv-win/bin/pyenv"

The same error occurs when I escape by myself.
I think it's a bug inside pyenv-win python, what do you think?
Since it is a remote operation, I would be happy if there is a solution that can be solved remotely, not on the server side.
In the end, it would be better to change the username, but I would like to solve the problem that cannot be changed remotely and where the escape processing problem is fundamentally occurring.

$HOME="Users/USER NAME"
$PYENV_ROOT="~/.pyenv"
$PYENV_HOME="~/.pyenv/pyenv-win"
$PYENV="~/.pyenv/pyenv-win"

python windows pyenv msys2

2022-09-30 19:51

1 Answers

If you are using pyenv-win, check the Finish the installation section of README.

Here is an excerpt of the highlights, but the following commands appear to have been executed from PowerShell to configure PATH:

[System.Environment]::SetEnvironmentVariable('PYENV', $env:USERPROFILE+"\.pyenv\pyenv-win\", "User")
System.Environment::SetEnvironmentVariable('PYENV_HOME', $env:USERPROFILE+"\.pyenv\pyenv-win\", "User")
[System.Environment]::SetEnvironmentVariable('path', $env:USERPROFILE+"\.pyenv\pyenv-win\bin;"+$env:USERPROFILE+"\.pyenv\pyenv-win\shims;"+[System.Environment][Uvection],"Uvection('Uvection'Uvection'Uvection'Uvection':"

I don't know where you set up the $PYENV_ROOT mentioned in the question, but I think the problem is caused by using ~ for Windows environments.


2022-09-30 19:51

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.