raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
341 stars 91 forks source link

ModuleNotFoundError: No module named 'raisimGymTorch' #472

Closed ddenizdemirtas closed 1 year ago

ddenizdemirtas commented 1 year ago

Hello.

I have been working on being able to simulate multiple agents on a single environment using raisimGymTorch before I got the above error message. When following the setup instructions on the website, I am getting the easy_install command is deprecated error log. Therefore, I tried to use pip3 with and without sudo for the installation process, but I am getting stuck with the following error logs. I was able to use raisimGymTorch until yesterday, so I don't know what went wrong. I would appreciate if I can get a help on what's the appropriate way to setup raisimGymTorch considering the error I am facing. In addition, I couldn't find resources about simulating multiple agents in the same environment using raisimGymTorch. Would the underlying environment support such action, if yes, I would appreciate if you could guide me on how? Thank you.

Error logs for running the command "sudo pip3 install -e ." :
error: Installing collected packages: raisim-gym-torch Running setup.py develop for raisim-gym-torch error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [60 lines of output]
    running develop
    /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release
      warnings.warn(
    /usr/lib/python3/dist-packages/pkg_resources/__init__.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release
      warnings.warn(
    running egg_info
    writing raisim_gym_torch.egg-info/PKG-INFO
    writing dependency_links to raisim_gym_torch.egg-info/dependency_links.txt
    writing requirements to raisim_gym_torch.egg-info/requires.txt
    writing top-level names to raisim_gym_torch.egg-info/top_level.txt
    reading manifest file 'raisim_gym_torch.egg-info/SOURCES.txt'
    adding license file 'LICENSE'
    writing manifest file 'raisim_gym_torch.egg-info/SOURCES.txt'
    running build_ext
    Traceback (most recent call last):
      File "/usr/local/bin/cmake", line 33, in <module>
        sys.exit(load_entry_point('cmake', 'console_scripts', 'cmake')())
      File "/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/__init__.py", line 43, in cmake
        raise SystemExit(_program('cmake', sys.argv[1:]))
      File "/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/__init__.py", line 39, in _program
        return subprocess.call([os.path.join(CMAKE_BIN_DIR, name)] + args, close_fds=False)
      File "/usr/lib/python3.10/subprocess.py", line 345, in call
        with Popen(*popenargs, **kwargs) as p:
      File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "/usr/lib/python3.10/subprocess.py", line 1733, in _execute_child
        self._posix_spawn(args, executable, env, restore_signals,
      File "/usr/lib/python3.10/subprocess.py", line 1678, in _posix_spawn
        self.pid = os.posix_spawn(executable, args, env, **kwargs)
    PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/data/bin/cmake'
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/home/biomechatronic/raisimLib/raisimGymTorch/setup.py", line 68, in <module>
        setup(
      File "/usr/lib/python3.10/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 34, in run
        self.install_for_development()
      File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 114, in install_for_development
        self.run_command('build_ext')
      File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command
        cmd_obj.run()
      File "/home/biomechatronic/raisimLib/raisimGymTorch/setup.py", line 32, in run
        out = subprocess.check_output(['cmake', '--version'])
      File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "/usr/lib/python3.10/subprocess.py", line 524, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1.
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> [60 lines of output] running develop /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 1.1build1 is an invalid version and will not be supported in a future release warnings.warn( /usr/lib/python3/dist-packages/pkg_resources/init.py:116: PkgResourcesDeprecationWarning: 0.1.43ubuntu1 is an invalid version and will not be supported in a future release warnings.warn( running egg_info writing raisim_gym_torch.egg-info/PKG-INFO writing dependency_links to raisim_gym_torch.egg-info/dependency_links.txt writing requirements to raisim_gym_torch.egg-info/requires.txt writing top-level names to raisim_gym_torch.egg-info/top_level.txt reading manifest file 'raisim_gym_torch.egg-info/SOURCES.txt' adding license file 'LICENSE' writing manifest file 'raisim_gym_torch.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "/usr/local/bin/cmake", line 33, in sys.exit(load_entry_point('cmake', 'console_scripts', 'cmake')()) File "/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/init.py", line 43, in cmake raise SystemExit(_program('cmake', sys.argv[1:])) File "/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/init.py", line 39, in _program return subprocess.call([os.path.join(CMAKE_BIN_DIR, name)] + args, close_fds=False) File "/usr/lib/python3.10/subprocess.py", line 345, in call with Popen(popenargs, kwargs) as p: File "/usr/lib/python3.10/subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.10/subprocess.py", line 1733, in _execute_child self._posix_spawn(args, executable, env, restore_signals, File "/usr/lib/python3.10/subprocess.py", line 1678, in _posix_spawn self.pid = os.posix_spawn(executable, args, env, kwargs) PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/data/bin/cmake' Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/biomechatronic/raisimLib/raisimGymTorch/setup.py", line 68, in setup( File "/usr/lib/python3.10/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.10/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/usr/lib/python3/dist-packages/setuptools/command/develop.py", line 114, in install_for_development self.run_command('build_ext') File "/usr/lib/python3.10/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.10/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/biomechatronic/raisimLib/raisimGymTorch/setup.py", line 32, in run out = subprocess.check_output(['cmake', '--version']) File "/usr/lib/python3.10/subprocess.py", line 420, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/lib/python3.10/subprocess.py", line 524, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['cmake', '--version']' returned non-zero exit status 1. [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.

jhwangbo commented 1 year ago

The error line is this: PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/data/bin/cmake' Traceback (most recent call last):

Use a conda environment instead. No sudo at any point. Delete all cache files from CMake and python setuptools.

You can pass in action that is a stack of actions for multiple agents. It's completely up to you how to interpret the action.

ddenizdemirtas commented 1 year ago

Thank you for your response. I am already in an active conda environment. After deleting the cache files, what's the appropriate setup command? Should I use python3 setup.py develop although it's depreciated, or pip3 install . ? Also, since I am a research intern, I don't have extensive experience with raisimGymTorch, and I am confused by what you meant by "pass in action that is a stack of actions for multiple agents".

Thank you for your time and help,

On Tue, Jun 6, 2023 at 10:42 AM Jemin Hwangbo @.***> wrote:

The error line is this: PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/dist-packages/cmake-3.26.3-py3.10-linux-x86_64.egg/cmake/data/bin/cmake' Traceback (most recent call last):

Use a conda environment instead. No sudo at any point. Delete all cache files from CMake and python setuptools.

You can pass in action that is a stack of actions for multiple agents. It's completely up to you how to interpret the action.

— Reply to this email directly, view it on GitHub https://github.com/raisimTech/raisimLib/issues/472#issuecomment-1578101266, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXI4CCVELAFMEJNDQACNBFTXJ3NNHANCNFSM6AAAAAAY37VYEQ . You are receiving this because you authored the thread.Message ID: @.***>

jhwangbo commented 1 year ago

python setup develop.

I think I misunderstood you. I guess you want to run multiple PPO for a single environment. For that, you have to change both C++ and PPO code. If you understand the raisimgymTorch code, you can probably do it. Otherwise, this is going to be tough

ddenizdemirtas commented 1 year ago

After modifying the PPO code, I am able to simulate for multiple agents, but I can only visualize one agent at a time on Unity. I suppose I have to make changes to the C++ code for visualizations. If you could vaguely direct me towards the correct modifications from a high-level, without taking your time too much, I would really appreciate it because there is virtually no online resources for this.

Thank you,

On Tue, Jun 6, 2023 at 10:53 AM Jemin Hwangbo @.***> wrote:

python setup develop.

I think I misunderstood you. I guess you want to run multiple PPO for a single environment. For that, you have to change both C++ and PPO code. If you understand the raisimgymTorch code, you can probably do it. Otherwise, this is going to be tough

— Reply to this email directly, view it on GitHub https://github.com/raisimTech/raisimLib/issues/472#issuecomment-1578118780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXI4CCQHTJEVXDZMCE4AXJLXJ3OYDANCNFSM6AAAAAAY37VYEQ . You are receiving this because you authored the thread.Message ID: @.***>

ddenizdemirtas commented 1 year ago

In addition, the python setup develop command you mentioned is getting me the same error logs I tried to avoid by using pip: /home/biomechatronic/anaconda3/envs/raisimGymTorch/lib/python3.11/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !!


    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer, pypa/build or
    other standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.

!! easy_install.initialize_options(self) /home/biomechatronic/anaconda3/envs/raisimGymTorch/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!


    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer, pypa/build or
    other standards-based tools.

    See

https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.


!! self.initialize_options() error: Cannot update time stamp of directory 'raisim_gym_torch.egg-info'

On Tue, Jun 6, 2023 at 10:57 AM Deniz Demirtas @.***> wrote:

After modifying the PPO code, I am able to simulate for multiple agents, but I can only visualize one agent at a time on Unity. I suppose I have to make changes to the C++ code for visualizations. If you could vaguely direct me towards the correct modifications from a high-level, without taking your time too much, I would really appreciate it because there is virtually no online resources for this.

Thank you,

On Tue, Jun 6, 2023 at 10:53 AM Jemin Hwangbo @.***> wrote:

python setup develop.

I think I misunderstood you. I guess you want to run multiple PPO for a single environment. For that, you have to change both C++ and PPO code. If you understand the raisimgymTorch code, you can probably do it. Otherwise, this is going to be tough

— Reply to this email directly, view it on GitHub https://github.com/raisimTech/raisimLib/issues/472#issuecomment-1578118780, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXI4CCQHTJEVXDZMCE4AXJLXJ3OYDANCNFSM6AAAAAAY37VYEQ . You are receiving this because you authored the thread.Message ID: @.***>

jhwangbo commented 1 year ago

There are two different options to visualize multiple agents. First one is using a single unity instance. You can use RaisimServer::focuseOn to move the camera to a different object. But sometimes this is difficult to capture all three agents on the same screen. So the other option is to make dummy world and associated server to visualize agents in different unity instances. For this, you have to set the port numbers different from each other. But this option will consume more system resources and not-so-clean code in your environment.

I don't understand what you mean by the same error. The first error was due to the sudo command. If you don't use sudo, you will not get it. Can you paste the whole error?

BTW, the current version of pybind11 does not support 3.11. Can you use 3.9 or 3.10 instead?

ddenizdemirtas commented 1 year ago

Thanks for your response. I solved the problem with raisimGymTorch. The two final questions I have is that, in order to simulate multiple agents in a single unity instance, should I make changes to the Environment.hpp, if yes, after making changes to the Environment.hpp, is another make command required to be called in it's directory? Finally, what is the way to import different robots to raisimgymtorch since instead of using robot's urdf, in the example python scripts, it imports it from the directory?

Thank you for your time and help,

On Tue, Jun 6, 2023 at 11:31 AM Jemin Hwangbo @.***> wrote:

There are two different options to visualize multiple agents. First one is using a single unity instance. You can use RaisimServer::focuseOn to move the camera to a different object. But sometimes this is difficult to capture all three agents on the same screen. So the other option is to make dummy world and associated server to visualize agents in different unity instances. For this, you have to set the port numbers different from each other. But this option will consume more system resources and not-so-clean code in your environment.

I don't understand what you mean by the same error. The first error was due to the sudo command. If you don't use sudo, you will not get it. Can you paste the whole error?

BTW, the current version of pybind11 does not support 3.11. Can you use 3.9 or 3.10 instead?

— Reply to this email directly, view it on GitHub https://github.com/raisimTech/raisimLib/issues/472#issuecomment-1578182750, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXI4CCT3SRHDQL3QYIH6LW3XJ3TEVANCNFSM6AAAAAAY37VYEQ . You are receiving this because you authored the thread.Message ID: @.***>

jhwangbo commented 1 year ago

- in order to simulate multiple agents in a single unity instance, should I make changes to the Environment.hpp, if yes, after making changes to the Environment.hpp, is another make command required to be called in it's directory? In this line https://github.com/raisimTech/raisimLib/blob/294441bb4495135803c90b5b60ac91b0649b40c7/raisimGymTorch/raisimGymTorch/env/envs/rsg_anymal/runner.py#LL127C9-L127C41 you have to modify the step function so that it takes multiple actions and returns multiple observation and rewards. You also have to modify their corresponding C++ functions.

- Finally, what is the way to import different robots to raisimgymtorch since instead of using robot's urdf, in the example python scripts, it imports it from the directory?

Yes, you have to spawn multiple agents in Environment.hpp. For example, anymal1 = world->addArticulatedSystem(...) anymal2 = world->addArticulatedSystem(...) anymal3 = world->addArticulatedSystem(...)

ddenizdemirtas commented 1 year ago

Hello. I have implemented the instructions you wrote in your last response. However, when I run runner.py, the environment has no updates. In other words, the Environment.hpp file is exactly the same as its initial version. To test this, I purposefully left some syntax mistakes in the Environment.hpp file to see if it would run. Again, it ran the initial version of the environment. I have tried compiling by running 'python setup.py develop' in the correct directory, but it wouldn't work. I have attached the logs that I am getting from running 'python setup.py develop' down below. I would appreciate it if you can point out what is it that I am wrong about updating/compiling the Environment.hpp file. Thank you. Logs: /home/biomechatronic/venv/yamltest/lib/python3.10/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` and ``easy_install``.
    Instead, use pypa/build, pypa/installer, pypa/build or
    other standards-based tools.

    See https://github.com/pypa/setuptools/issues/917 for details.
    ********************************************************************************

!! easy_install.initialize_options(self) /home/biomechatronic/venv/yamltest/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer, pypa/build or
    other standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!! self.initialize_options() error: Cannot update time stamp of directory 'raisim_gym_torch.egg-info'