huawei-noah / SMARTS

Scalable Multi-Agent RL Training School for Autonomous Driving
MIT License
936 stars 187 forks source link

'make sanity-test' ERROR #2152

Closed Silkbamboo closed 5 months ago

Silkbamboo commented 5 months ago

High Level Description

I want to run the test make sanity-test

Version

2.0.1

Operating System

18.04

Problems

when I run SMARTS# make sanity-test

______________________________ ERROR collecting examples/tests/test_examples.py ______________________________
ImportError while importing test module '/home/czj/SMARTS/examples/tests/test_examples.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
examples/tests/test_examples.py:8: in <module>
    from hydra import compose, initialize_config_dir
E   ModuleNotFoundError: No module named 'hydra'
___________________________ ERROR collecting smarts/env/tests/test_social_agent.py ___________________________
ImportError while importing test module '/home/czj/SMARTS/smarts/env/tests/test_social_agent.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
smarts/env/tests/test_social_agent.py:22: in <module>
    import gymnasium as gym
E   ModuleNotFoundError: No module named 'gymnasium'
------------------------ generated xml file: /home/czj/SMARTS/sanity_test_result.xml -------------------------
========================================== short test summary info ===========================================
ERROR examples/tests/test_examples.py
ERROR smarts/env/tests/test_social_agent.py
============================================= 2 errors in 1.62s ==============================================

I want to know how to deal with this error and run test.

Gamenot commented 5 months ago

This would be the result of not installing the [examples] option.

i.e.


pip install -e ".[examples]"
Silkbamboo commented 5 months ago

This would be the result of not installing the [examples] option.

i.e.

pip install -e ".[examples]"

Thank you, I have solved it.