metadriverse/scenarionet

Question regarding conflicting dependencies

Closed this issue · 5 comments

I have installed scenarionet and metadrive successfully but when I run the following command to install the waymo-open-dataset on ubuntu 20.04 LTS through WSL 2

pip install waymo-open-dataset-tf-2-11-0==1.5.0

I get the following error ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.
seaborn 0.13.0 requires matplotlib!=3.6.1,>=3.3, but you have matplotlib 3.6.1 which is incompatible.
metadrive-simulator 0.4.1.2 requires numpy<=1.24.2,>=1.21.6, but you have numpy 1.21.5 which is incompatible.
scenarionet 0.0.1 requires numpy<=1.24.2,>=1.21.6, but you have numpy 1.21.5 which is incompatible.

This is how I installed scenarionet and metadrive

mkdir mdsn
cd mdsn

git clone https://github.com:metadriverse/metadrive.git
cd metadrive
pip install -e.
cd ../

git clone https://github.com:metadriverse/scenarionet.git
cd scenarionet
pip install -e .

The other proposed method to install waymo

pip install -e .[waymo]

Resulted in the following error

ERROR: Cannot install scenarionet because these package versions have conflicting dependencies.

The conflict is caused by:
tensorflow 2.11.0 depends on protobuf<3.20 and >=3.9.2
metadrive-simulator 0.4.1.1 depends on protobuf==3.20.3

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Thank you for the feedback! We are going to fix it.

In your first trial, does it work? I think pip now just throws the error message, and will keep installing packages with conflicts. You can still use the waymo-open-dataset lib.

Actually, I removed the dependency for protobuf in metadrive-simulator=0.4.1.2. Could you upgrade your MetaDrive version before using the second way to install it?

The error still shows but running pip check results in no error's so the issue has been resolved thank you! Trying to complete the waymo example from the docs however results in the following error.

(scenarionet) wisley@DI2BELVN0178WNB:~/mdsn$ python -m scenarionet.convert_waymo -d /home/wisley/waymo_converted/ --raw_data_path /home/wisley/waymo_dta --num_files=1
Traceback (most recent call last):
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/wisley/mdsn/scenarionet/scenarionet/convert_waymo.py", line 11, in <module>
    from scenarionet.converter.utils import write_to_directory
  File "/home/wisley/mdsn/scenarionet/scenarionet/converter/utils.py", line 15, in <module>
    from metadrive.scenario import ScenarioDescription as SD
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/metadrive/__init__.py", line 1, in <module>
    import metadrive.register
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/metadrive/register.py", line 1, in <module>
    import gymnasium as gym
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/gymnasium/__init__.py", line 12, in <module>
    from gymnasium.envs.registration import (
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/gymnasium/envs/__init__.py", line 4, in <module>
    from gymnasium.envs.registration import (
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/gymnasium/envs/registration.py", line 20, in <module>
    from gymnasium.wrappers import (
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/gymnasium/wrappers/__init__.py", line 49, in <module>
    from gymnasium.wrappers.atari_preprocessing import AtariPreprocessing
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/gymnasium/wrappers/atari_preprocessing.py", line 9, in <module>
    import cv2
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/cv2/__init__.py", line 175, in bootstrap
    if __load_extra_py_code_for_module("cv2", submodule, DEBUG):
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/cv2/__init__.py", line 28, in __load_extra_py_code_for_module
    py_module = importlib.import_module(module_name)
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/home/wisley/miniconda3/envs/scenarionet/lib/python3.9/site-packages/cv2/typing/__init__.py", line 69, in <module>
    NumPyArrayGeneric = numpy.ndarray[typing.Any, numpy.dtype[numpy.generic]]
TypeError: 'numpy._DTypeMeta' object is not subscriptable

Yes. I reproduced your problem. Could you try pip install numpy==1.24.2?

It solved my problem, thank you!