Skip to content

Python Command preferences crash #6768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AndrewGerstenslager opened this issue Feb 3, 2025 · 1 comment
Open

Python Command preferences crash #6768

AndrewGerstenslager opened this issue Feb 3, 2025 · 1 comment

Comments

@AndrewGerstenslager
Copy link

This is a problem where I was trying to upgrade to webots 2025a from 2021a so I could use a more modern python version so windows could see the GPU with torch.

So I was trying to point webots to a different python runtime and I set this in the preferences:
Python Command: conda run -n myenv python

Which was a mistake because webots crashed immediately and would only work if I deleted the contents of the world file that webots pointed to last. Even reinstalling webots didn't help because it stored some cache somewhere that I couldn't find to undo my mistake.

I realized this was the way to do it:
Python Command: C:\Users<Username>\Anaconda3\envs\myenv\python.exe

If there's a way to catch this error before constantly crashing, that could be potentially helpful! Or some guidance on how to point to different python executables such as anaconda environments and virtual python environments.

@Davidwarchy
Copy link

Fatal Crash on Wrong Python Command

I had a similar problem. I want the system to have a virtual environment. Normally one changes it in the preferences menu

Image

I needed to use a virtual environment to run the python controller, so I put the path to the python.exe in the python command tab:
.torchgpu/Scripts/python.exe

But there was a typo: .torchgpu/Scripts/pythonexe (no dot before 'exe')

Thing is that Webots crashed. Each restart ended up in a crash before there was any discernible action in the scene. Also Webots didn't give me enough time to change preferences, so this is a bit of an issue.

The problem persists even if uninstall and restart the system and install again. I did this a few times, to much chagrin.

Solution

The solution to this was going to the registry and changing the value for Computer\HKEY_CURRENT_USER\Software\Cyberbotics\Webots-R2025a\General\pythonCommand` to the correct path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants