Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python install problem #140

Closed
SiyuanHuang95 opened this issue Jul 25, 2023 · 12 comments
Closed

Python install problem #140

SiyuanHuang95 opened this issue Jul 25, 2023 · 12 comments

Comments

@SiyuanHuang95
Copy link

SiyuanHuang95 commented Jul 25, 2023

Hi,

thanks for the sharing.

After cmake and make, I could run the GUI with C++ version successfully, very impressive!

And then, I removed the build/ folder and tried to use

cd python/
pip install -e .

to install the python version, however, the process has already taken about 2 hrs, and I can only see something like " Running setup.py develop for mujoco-mpc" in the terminal, at the same time, I found that the build/ folder is growing at first and then stay consistently:

Every 5.0s: du --max-depth=1 -h                                                                 

1.5G    ./_deps
16K     ./mjpc
400K    ./CMakeFiles
8.0K    ./grpc
1.5G    .

Was that normal? Or is there anything wrong with my operation?

Or, is there any walk-around like docker or Py-PIP to obtain that python package?

@SiyuanHuang95
Copy link
Author

After some hours waiting, it gives me:

Successfully installed mujoco-mpc-0.1.0

with the build folder:

288K    ./gens
615M    ./lib
520K    ./protos
3.1G    ./_deps
4.0K    ./http_archives
19M     ./mjpc
311M    ./bin
1.6M    ./CMakeFiles
16M     ./grpc
4.0G    .

however, when try

python ui_agent_test.py

error raises:

ModuleNotFoundError: No module named 'mujoco_mpc.proto'

Should I re-install it?

@SiyuanHuang95
Copy link
Author

After many trail and errors, I finally successfully install it. Some lessons:

  1. Do not use pip install -e, just use install, this will speed-up the process if you do not need to modify some source codes.
  2. USE python>=3.10!

@SiyuanHuang95
Copy link
Author

I have successfully run some test scripts:

  1. python agent_test.py -> success
  2. python ui_agent_test.py -> success
  3. python estimator_test.py -> cannot import name 'estimator_pb2' from 'mujoco_mpc.proto' (/home/XXX/anaconda3/envs/mjpc/lib/python3.10/site-packages/mujoco_mpc/proto/init.py)

I install the packages with:

python setup.py install
python setup_estimator.py install

and both give me the success flag.

@SiyuanHuang95 SiyuanHuang95 reopened this Jul 26, 2023
@SiyuanHuang95
Copy link
Author

I also tried with

pip install PATH/mujoco_mpc/python

and the terminal gives me:

**byte-compiling build/bdist.linux-x86_64/egg/mujoco_mpc/proto/estimator_pb2.py to estimator_pb2.cpython-310.pyc**
**byte-compiling build/bdist.linux-x86_64/egg/mujoco_mpc/proto/agent_pb2.py to agent_pb2.cpython-310.pyc**
**byte-compiling build/bdist.linux-x86_64/egg/mujoco_mpc/proto/estimator_pb2_grpc.py to estimator_pb2_grpc.cpython-310.pyc**
...


Using /XX/anaconda3/envs/mjpc/lib/python3.10/site-packages
Finished processing dependencies for mujoco-mpc==0.1.0

So I thought the install process is successful?

But the python estimator_test.py -> cannot import name 'estimator_pb2' from 'mujoco_mpc.proto' (/home/XXX/anaconda3/envs/mjpc/lib/python3.10/site-packages/mujoco_mpc/proto/init.py)

Any help and information is indeed appreciate!

@thowell
Copy link
Collaborator

thowell commented Aug 2, 2023

I do the following:

  1. run python python/setup.py install from the mujoco_mpc directory
  2. test that the install was successful with python python/mujoco_mpc/agent_test.py

@thowell
Copy link
Collaborator

thowell commented Aug 2, 2023

If you still encounter issues, feel free to reach out via email to me and I can walk you through the install and using MJPC python in a colab notebook.

@SiyuanHuang95
Copy link
Author

I do the following:

  1. run python python/setup.py install from the mujoco_mpc directory
  2. test that the install was successful with python python/mujoco_mpc/agent_test.py

Hi, @thowell, great thanks for your reply.

I can also test the installation successfully with python python/mujoco_mpc/agent_test.py, but no success for the * estimator_test.py*. The biggest problem is with the proto stuff used in the estimator.

@thowell
Copy link
Collaborator

thowell commented Aug 2, 2023

#142 should fix this

@thowell
Copy link
Collaborator

thowell commented Aug 2, 2023

Are you installing the estimator first: python python/setup_estimator.py install?

@SiyuanHuang95
Copy link
Author

SiyuanHuang95 commented Aug 2, 2023

Are you installing the estimator first: python python/setup_estimator.py install?

Hi thanks for your reply @thowell

Nopes, I directly run with

pip install PATH/mujoco_mpc/python

will this make a big difference?

Update:

I also tried with

python setup.py install
python setup_estimator.py install

also no success with python estimator_test.py

@Hither1
Copy link

Hither1 commented Sep 28, 2023

Is setup_estimator.py replaced by setup_batch.py in the latest version?

@thowell
Copy link
Collaborator

thowell commented Dec 22, 2023

@SiyuanHuang95 the README is updated with improved installation instructions.
@Hither1 the latest filename is setup_direct.py.

@thowell thowell closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants