google-deepmind / mujoco_mpc

Real-time behaviour synthesis with MuJoCo, using Predictive Control
https://github.com/deepmind/mujoco_mpc
Apache License 2.0
952 stars 142 forks source link

Buile error with cmake and pip #211

Closed Caracal117 closed 8 months ago

Caracal117 commented 10 months ago

I tried to build the repo with two installation method s on Ubuntu 20.04 in Readme file.

In the cmake case, I finished configure & build with VScode plug-in. But when I tried to run in "debug" the system has error like: [cmake] CMake Error at mjpc/CMakeLists.txt:35 (add_custom_command): [cmake] Error evaluating generator expression: [cmake] [cmake] $ [cmake] [cmake] No target "protoc" which I met before in building process, I solved it by install protobuf-compiler libprotobuf-dev. But it occured again. Moreover, what does it mean by run the "mjpc" target? Does it mean to run the whole folder?

In python case, i've tried pip install and python one with "setup.py". Both give me the feedback of mujoco-mpc 0.1.0 is installed under .../mujoco_mpc/python But when I tried to run the test case, e.g. agent_test.py The error message is: ModuleNotFoundError: No module named 'mujoco_mpc.proto'

So, I tried to run the other two setup script with: python python/setup_filter.py install, but got the error messege like this:

[1839/1839] Linking CXX executable bin/filter_server running copy_filter_server_binary Traceback (most recent call last): File "/home/cara/Desktop/mujoco_mpc/mujoco_mpc/python/setup_filter.py", line 266, in setuptools.setup( File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/init.py", line 107, in setup return distutils.core.setup(**attrs) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/command/install.py", line 80, in run self.do_egg_install() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/command/install.py", line 129, in do_egg_install self.run_command('bdist_egg') File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/command/bdist_egg.py", line 164, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/command/bdist_egg.py", line 150, in call_command self.run_command(cmdname) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/command/install_lib.py", line 11, in run self.build() File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/command/install_lib.py", line 111, in build self.run_command('build_ext') File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/cara/Desktop/mujoco_mpc/mujoco_mpc/python/setup_filter.py", line 209, in run self.run_command("copy_filter_server_binary") File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/dist.py", line 1234, in run_command super().run_command(command) File "/home/cara/anaconda3/envs/mjpc/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/cara/Desktop/mujoco_mpc/mujoco_mpc/python/setup_filter.py", line 117, in run self._copy_binary("filter_server") File "/home/cara/Desktop/mujoco_mpc/mujoco_mpc/python/setup_filter.py", line 122, in _copy_binary raise ValueError( ValueError: Cannot find filter_server binary from ../build/bin/filter_server. Please build the {binary_name} C++ gRPC service.

I think some issues might result from attempt both method under same directory, because they share the same build folder. What should I do next?

Edu4000 commented 10 months ago

Hello, I ran into the same issue earlier this week. Seems that they recently modified one of the paths of setup.py but did not changed it insetup_filter.py nor setup_direct.py. The following worked for me.

Try, modifying the following line in both setup files from this

[filter/direct]_proto_source_path = Path("..", "grpc", [filter/direct]_proto_filename).resolve()

to this

[filter/direct]_proto_source_path = Path("..", "mjpc", "grpc", [filter/direct]_proto_filename).resolve()

JSun950313 commented 9 months ago

Hello, I ran into the same issue earlier this week. Seems that they recently modified one of the paths of setup.py but did not changed it insetup_filter.py nor setup_direct.py. The following worked for me.

Try, modifying the following line in both setup files from this

[filter/direct]_proto_source_path = Path("..", "grpc", [filter/direct]_proto_filename).resolve()

to this

[filter/direct]_proto_source_path = Path("..", "mjpc", "grpc", [filter/direct]_proto_filename).resolve()

I tried it and still have the same error. and the related files were installed on another path: venv/lib64/python3.10/site-packages/mujoco_mpc-0.1.0-py3.10-linux-x86_64.egg/mujoco_mpc

thowell commented 8 months ago

I think this issue is resolved now? Additionally, the pip install instructions are removed from the README to avoid confusion #233.