rickstaa / ros-gazebo-gym

Framework for integrating ROS and Gazebo with gymnasium, streamlining the development and training of RL algorithms in realistic robot simulations.
https://rickstaa.dev/ros-gazebo-gym/
MIT License
27 stars 2 forks source link

AttributeError: module 'numpy' has no attribute 'bool'. #6

Closed rickstaa closed 1 year ago

rickstaa commented 1 year ago

Sometimes you will encounter the following error message when trying to use the ros-gazebo-gym package:

  import pandas._libs.testing as _testing                                                                                                                                                                  
Traceback (most recent call last):                                                                                                                                                                         
  File "<string>", line 1, in <module>                                                                                                                                                                     
  File "/home/ricks/venvs/ros-gazebo-gym/lib/python3.8/site-packages/pandas/__init__.py", line 180, in <module>                                                                                            
    import pandas.testing                                                                                                                                                                                  
  File "/home/ricks/venvs/ros-gazebo-gym/lib/python3.8/site-packages/pandas/testing.py", line 5, in <module>                                                                                               
    from pandas._testing import (                                                                                                                                                                          
  File "/home/ricks/venvs/ros-gazebo-gym/lib/python3.8/site-packages/pandas/_testing.py", line 24, in <module>                                                                                             
    import pandas._libs.testing as _testing                                                                                                                                                                
  File "pandas/_libs/testing.pyx", line 10, in init pandas._libs.testing                                                                                                                                   
  File "/usr/local/lib/python3.8/dist-packages/numpy/__init__.py", line 305, in __getattr__                                                                                                                
    raise AttributeError(__former_attrs__[attr])                                                                                                                                                           
AttributeError: module 'numpy' has no attribute 'bool'.                                                                                                                                                    
`np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the nu
mpy scalar type, use `np.bool_` here.                                                                                                                                                                      
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:                                                                                       
    https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

This error is caused by the installed [pandas](https://pandas.pydata.org/ and numpy libraries on your system to not be compatible (see https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations). This happens when you install numpy with pip while pandas is installed through the system repositories. You can solve this issue by uninstalling the numpy or installing pandas using pip (i.e. pip uninstall numpy or pip install pandas).