Search code examples
pythonwebots

Webots using Python 2.7 when Python 3.x is default


On my mac I switched python versions to 3.7 and when using the command python -V in the terminal it shows that it successfully switched. Webots still shows that the deprecated 2.7 version is being used. When I checked the command, it says python

I've messed with creating a runtime.ini as well, which seemed to work but doesn't recognize webot modules like "Controller," or "Robot." Though I can't find anything about what the module names would be and how I could include them in the Options for the runtime.ini with the -m flag.

Any help would be appreciated, thanks


Solution

  • I was able to solve this by setting the absolute path, shown in the image link, to a valid version of Python 3 in the Webots->Preferences command field. I had a slight error with NumPy not coming with this version but was easily fixable by doing <absolute-path-to-version-specified> -m pip install NumPy

    I hope this is helpful to others as it was the last thing I tried and cost me some time.

    Webots preferences screenshot example