Skip to content

Commit 0eb3b1d

Browse files
committed
Improve guidance on setting the path to Python in Webots
Based on helping a team this afternoon.
1 parent 0242bdc commit 0eb3b1d

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

simulator/index.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,30 @@ You may receive a warning about your computer's GPU not being good enough, which
3535

3636
#### Changing your version of Python
3737

38-
If webots is picking up the incorrect version of Python, you'll need to change it.
39-
This can be done using **Tools** &rarr; **Preferences** &rarr; **General** &rarr; **Python command** (or **Webots** &rarr; **Preferences** <kbd>⌘</kbd><kbd>,</kbd> on a Mac).
38+
If webots is not picking any version of Python or is picking up the wrong one then you'll need to change it.
39+
When this happens Webots will print errors to its console and your robot will not move.
40+
41+
You will need the full path to the version of Python that you want to use.
42+
This will vary based on the system you have.
43+
One way to find the path is by launching the version of Python that you want to
44+
use and running the following code:
45+
46+
~~~~~ python
47+
import sys
48+
print(sys.executable)
49+
~~~~~
50+
51+
On Windows you can set the path to the Python version to use in Webots UI via
52+
**Tools** &rarr; **Preferences** &rarr; **General** &rarr; **Python command**.
53+
Your Python path is likely similar to `C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python39\python.exe` when using Python 3.9, where `<USERNAME>` is your login.
54+
55+
On Mac you can set the path to the Python version to use via **Webots** &rarr; **Preferences** <kbd>⌘</kbd><kbd>,</kbd>.
56+
Your Python path is likely similar to `/Library/Frameworks/Python.framework/Versions/3.9/bin/python3` when using Python 3.9.
57+
4058
You'll need to ensure a matching version of Python is installed. If you're still
4159
having problems, ask for help in [`#simulator-help`][simulator-help] in
4260
[Discord][discord].
4361

44-
On Windows your Python path is likely `C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python39\python.exe` where `<USERNAME>` is your login.
45-
On Mac your Python path is likely `/Library/Frameworks/Python.framework/Versions/3.9/bin/python3` when using Python 3.9.
46-
4762
### Updates
4863

4964
Occasionally, we may release an update to the simulation. To update, you will need to delete the `competition-simulator-<version>` directory, and re-download it using the above link.

0 commit comments

Comments
 (0)