AttributeError: module 'carla' has no attribute 'WeatherParameters'

Build Carla from source (v 0.9.10) and build scenario runner from source (v 0.9.10) in Windows 10 using python 3.9

Added the environment variables and python paths as shown:
set CARLA_ROOT = C:\Users\simple\Desktop\Carla
set SCENARIO_RUNNER_ROOT = C:\Users\simple\Documents\scenario Runner\scenario_runner
set PYTHONPATH=C:\python;C:\Users\simple\Desktop\Carla\PythonAPI\carla\dist\carla-0.9.10-py3.9-win-amd64
set PYTHONPATH=C:\python;C:\Users\simple\Desktop\Carla\PythonAPI\carla
set PYTHONPATH=C:\python;C:\Users\simple\Desktop\Carla\PythonAPI

Note: In C:\Users\simple\Desktop\Carla\PythonAPI\carla\dist\ .egg filename was ‘carla-0.9.10-py3.9-win-amd64’ without .egg . So while setting the python path, set the path as:
set PYTHONPATH=C:\python;C:\Users\simple\Desktop\Carla\PythonAPI\carla\dist\carla-0.9.10-py3.9-win-amd64

Then tried the following:

In a new terminal,
Ran the carla server from carla root directory using the command: make launch
Pressed Play in the UE editor.

In another terminal,
executed: python scenario_runner.py --scenario FollowLeadingVehicle_1 --reloadWorld
and got the below error:

C:\Users\simple\Documents\scenario Runner\scenario_runner>python scenario_runner.py --scenario FollowLeadingVehicle_1 --reloadWorld
Traceback (most recent call last):
File “C:\Users\simple\Documents\scenario Runner\scenario_runner\scenario_runner.py”, line 35, in from srunner.scenarioconfigs.openscenario_configuration import OpenScenarioConfiguration File “C:\Users\simple\Documents\scenario Runner\scenario_runner\srunner\scenarioconfigs\openscenario_configuration.py”, line 21, in
from srunner.scenarioconfigs.scenario_configuration import ActorConfigurationData, ScenarioConfiguration File “C:\Users\simple\Documents\scenario Runner\scenario_runner\srunner\scenarioconfigs\scenario_configuration.py”, line 65, in
class ScenarioConfiguration(object): File “C:\Users\simple\Documents\scenario Runner\scenario_runner\srunner\scenarioconfigs\scenario_configuration.py”, line 83, in ScenarioConfiguration
weather = carla.WeatherParameters()
AttributeError: module ‘carla’ has no attribute ‘WeatherParameters’

Desktop :

  • OS: [Windows 10]
  • CARLA Version [CARLA 0.9.10]
  • Python version [3.9.0] [Only python 3.9 is installed in system]
  • Scenario_runner Version [0.9.10]

Please provide support for this issue. Is scenario_runner compatible with python 3.5 and 3.6 only and not with 3.9?

Hey TechManiac. First of all, I understand that this issue is also yours?

I can’t tell you for sure that ScenarioRunner is compatible with Python 3.9, but this issue isn’t related to it. The issue you are having is that the CARLA’s API isn’t being correctly detected.

This might be because of the note you’ve posted about not having the .egg name. I haven’t used CARLA with Windows but have you tried adding the .egg part to the PYTHONPATH?

1 Like