Prompt showing "NO VERSION" for python and it takes a long time #6220
Replies: 2 comments 15 replies
-
@UID1 it seems you have pyenv installed which makes it run a bat file and that just fails:
|
Beta Was this translation helpful? Give feedback.
-
This is admittedly the first program I have ever written in go. I applied this modification to measure time: package main
import (
"fmt"
"os"
"os/exec"
"time"
)
func main() {
home_path := os.Getenv("HOMEPATH")
fmt.Println("Homepath is : " + home_path)
command1 := "pyenv"
command2 := "cscript"
// Command 1 argument
argument := []string{"version-name"}
// Command 2 arguments
arguments := []string{
"/nologo",
home_path + "\\.pyenv\\pyenv-win\\libexec\\pyenv.vbs",
"version-name"}
fmt.Println()
fmt.Println("Testing running command 'pyenv version-name':")
start := time.Now()
RunCommand(command1, argument)
end := time.Since(start)
fmt.Println("Command took :", end)
fmt.Println("Testing running vbscript")
start = time.Now()
RunCommand(command2, arguments)
end = time.Since(start)
fmt.Println("Command took :", end)
}
func RunCommand(cmd string, args []string) {
cmd_h := exec.Command(cmd, args...)
out, err := cmd_h.Output()
if err != nil {
fmt.Println(err.Error())
}
fmt.Println(string(out))
} When executing it, I get the following results:
As can be seen, the first command takes over 10 seconds to execute. I examined further why On the old computer I had python version 3.12.7 and 3.9.6 and on the new one I have only 3.13.2 installed. So when issuing that command, it tries to access those python versions but when it cannot find them it tries to a search which is what is taking so much time for the command. So it successfully finds 3.13.2 on the new computer but not 3.12.7 and 3.9.6 which is not installed. I have spent some time trying to figure out why pyenv takes such a long time but I cannot find the source of the problem. The thing is almost all kind of interactions with |
Beta Was this translation helpful? Give feedback.
-
o I installed powershell 7, pyenv and omp on a fresh computer running Windows 11. When cd:ing into a directory where I have my python files, OMP suddenly takes a very long time to generate the command prompt and it fails to report the correct version of Python showing "NO VERSION" while I have no poblem getting the version string from both
python --version
andpython3 --version
.After digging through documentation I found myself hopeless as to how to resolve this issue.
The following debug log should probably tell the rest of the story:
How can I trace out how the OMP parses the interactions with the python interpreter and where it goes wrong? This most likely is some bug though.
Beta Was this translation helpful? Give feedback.
All reactions