RobustFieldAutonomyLab/DRL_graph_exploration

ModuleNotFoundError: No module named 'build.ss2d'

t-thanh opened this issue · 8 comments

python test.py return error

Traceback (most recent call last):
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/exploration_env.py", line 16, in <module>
    from envs.pyplanner2d import EMExplorer
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/pyplanner2d.py", line 4, in <module>
    from envs.pyss2d import *
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/pyss2d.py", line 6, in <module>
    from envs.utils import *
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/utils.py", line 8, in <module>
    import build.ss2d as ss2d
ModuleNotFoundError: No module named 'build.ss2d'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 8, in <module>
    import envs.exploration_env as robot
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/exploration_env.py", line 19, in <module>
    raise error.DependencyNotInstalled('{}. Build em_exploration and export PYTHONPATH=build_dir'.format(e))
gym.error.DependencyNotInstalled: No module named 'build.ss2d'. Build em_exploration and export PYTHONPATH=build_dir

How can I install module build.ss2d??

Please use Python3 to run the code. Try python3 test.py

@fanfeichen Yes, I did use python3 :)

Follow the instruction from the error, I did build em_exploration but not sure that I did the part: export PYTHONPATH=build_dir correctly. Is the build_dir actually folder/to/your/em_exploration/build?

Even after export PYTHONPATH=build_dir, I still have the same error, so I think the PYTHONPATH still not done correctly.

Best regards,

Solved by export PYTHONPATH=/path/to/folder/drl-explore/DRL_graph_exploration/build:$PYTHONPATH - I think it should be added in the README.md, and change in the warning code, cause I thought that I need to install em_exploration.

I got other issue while running python3 test.py:

This is example  0
/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
  warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Traceback (most recent call last):
  File "test.py", line 206, in <module>
    exp_data = generator(i)
  File "test.py", line 91, in generator
    env.render(mode=mode)
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/exploration_env.py", line 429, in render
    self._sim.plot()
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/pyplanner2d.py", line 114, in plot
    super(EMExplorer, self).plot()
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/pyss2d.py", line 241, in plot
    plot_virtual_map(self._virtual_map, self._map_params)
  File "/mnt/c/Users/tient/Documents/WSL/sources/drl-explore/DRL_graph_exploration/scripts/envs/utils.py", line 148, in plot_virtual_map
    map_params.min_y, map_params.max_y])
  File "/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/matplotlib/__init__.py", line 1447, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/matplotlib/axes/_axes.py", line 5521, in imshow
    resample=resample, **kwargs)
  File "/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/matplotlib/image.py", line 911, in __init__
    **kwargs
  File "/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/matplotlib/image.py", line 246, in __init__
    cbook._check_in_list(["upper", "lower"], origin=origin)
  File "/mnt/c/Users/tient/Documents/WSL/miniconda3/envs/drl-explore/lib/python3.6/site-packages/matplotlib/cbook/__init__.py", line 2268, in _check_in_list
    .format(v, k, ', '.join(map(repr, values))))
ValueError: 'low left' is not a valid value for origin; supported values are 'upper', 'lower'

I think it is link with matplotlib version, I have matplotlib 3.3.3, python3.6 (Ubuntu 18.04 WSL in Windows10)

SOLVED! by changing the line 146 of file scripts/envs/utils.py

from

 ax.imshow(array, origin='low left', alpha=alpha, cmap='bone_r', vmin=0.0, vmax=1.0,

to

ax.imshow(array, origin='lower', alpha=alpha, cmap='bone_r', vmin=0.0, vmax=1.0,

Close this issue!

I also met the problem.
No module named 'build.ss2d'. Build em_exploration and export PYTHONPATH=build_dir
I can't solved the problem by export PYTHONPATH=/root/DRL_graph_exploration/build:$PYTHONPATH.
What should I do?

SOLVED! by changing the line 146 of file scripts/envs/utils.py

from

 ax.imshow(array, origin='low left', alpha=alpha, cmap='bone_r', vmin=0.0, vmax=1.0,

to

ax.imshow(array, origin='lower', alpha=alpha, cmap='bone_r', vmin=0.0, vmax=1.0,

Close this issue!

Thanks! I just updated the content in the readme file and the utils.py file.

I also met the problem.
No module named 'build.ss2d'. Build em_exploration and export PYTHONPATH=build_dir
I can't solved the problem by export PYTHONPATH=/root/DRL_graph_exploration/build:$PYTHONPATH.
What should I do?

Can you add this export PYTHONPATH=/path/to/folder/DRL_graph_exploration/build:$PYTHONPATH to your ~/.bashrc file and try again?

I solved the problem. Please don't use conda virtual environment!