eanswer / TactileSimulation

[CoRL 2022] Efficient Tactile Simulation with Differentiability for Robotic Manipulation
https://people.csail.mit.edu/jiex/papers/TactileSim/index.html
63 stars 4 forks source link

could not import redmax_py #5

Open Navneet-Kaur21 opened 10 months ago

Navneet-Kaur21 commented 10 months ago

I have tried installing using the source and the docker method. (For both DiffHand and TactileSimulation) I keep getting the same error again and again. Could you please help solving this?

Traceback (most recent call last): File "test_sim_speed.py", line 13, in import redmax_py as redmax ModuleNotFoundError: No module named 'redmax_py'

eanswer commented 10 months ago

Did you install DiffRedMax successfully (Step 4 in README instruction):

cd externals/DiffHand/core
python setup.py install

After you successfully install it, you should be able to import redmax_py in your conda environment.

Navneet-Kaur21 commented 10 months ago

Hi Jie

Yes, I did. Here is the screenshot of the output after running the install command. [image: image.png]

On Fri, Nov 17, 2023 at 9:29 AM Jie Xu @.***> wrote:

Did you install DiffRedMax successfully (Step 4 in README instruction):

cd externals/DiffHand/core python setup.py install

After you successfully install it, you should be able to import redmax_py in your conda environment.

— Reply to this email directly, view it on GitHub https://github.com/eanswer/TactileSimulation/issues/5#issuecomment-1816818476, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP3DUW5RLZ2CLRZ2UKH7RWLYE6NIBAVCNFSM6AAAAAA7PQNCBKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJWHAYTQNBXGY . You are receiving this because you authored the thread.Message ID: @.***>

Navneet-Kaur21 commented 10 months ago

Screenshot from 2023-11-17 09-49-00~2

Navneet-Kaur21 commented 10 months ago

I have followed the instructions in the README file. (docker and source both). In both the cases it gives the same error.

eanswer commented 10 months ago

That's strange. I just tried to install the codebase from scratch and it works for me. Right after you install redmax_py and open a python session in your command line, could you run import redmax_py? image

Navneet-Kaur21 commented 10 months ago

On running import redmax_py I get this: Screenshot from 2023-11-17 10-33-22

eanswer commented 10 months ago

I see, could you check two things for me:

  1. Which python path you are using, run below in terminal

    which python
  2. Check whether redmax_py is installed in your conda environment:

    pip list | grep redmax-py
eanswer commented 10 months ago

May be also which pip

Navneet-Kaur21 commented 10 months ago
  1. /home/anaconda3/bin/python
  2. returns nothing.
  3. /home/anaconda3/bin/pip
eanswer commented 10 months ago

It seems that you are not in your conda env as shown in the python and pip path

Navneet-Kaur21 commented 10 months ago

Okay. Here are the results in the env:

  1. /home/navneetkaur/anaconda3/envs/tactile_control_env/bin/python
  2. redmax-py 0.0.1
  3. /home/navneetkaur/anaconda3/envs/tactile_control_env/bin/pip
eanswer commented 10 months ago

Then it seems you have installed redmax_py. Can you import it if you open a python via /home/navneetkaur/anaconda3/envs/tactile_control_env/bin/python

Navneet-Kaur21 commented 10 months ago

Uhh no. (tactile_control_env) navneetkaur@navneet:~/TactileSimulation/externals/DiffHand/core$ /home/navneetkaur/anaconda3/envs/tactile_control_env/bin/python Python 3.8.0 (default, Nov 6 2019, 21:49:08) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.

import redmax_py Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'redmax_py'

eanswer commented 10 months ago

that's so weird, I'm sorry that I have no other ideas about what went wrong...

Navneet-Kaur21 commented 10 months ago

I tried it with a different pc. It is giving the same error. Could there be anything missing in the installation? Some prerequisites that I need before I can install it successfully?

Runze-Zhao commented 9 months ago

I have run into the same issue

Navneet-Kaur21 commented 9 months ago

could you please let me know if you figure it out @Runze-Zhao

I have run into the same issue

Navneet-Kaur21 commented 9 months ago

also, @eanswer could you share the folder - anaconda3/envs/tactile_control_env/lib/python3.8/site-packages/redmax_py-0.0.1-py3.8-linux-x86_64.egg or what files should it contain.

Runze-Zhao commented 9 months ago

could you please let me know if you figure it out @Runze-Zhao

I have run into the same issue

The problem on my side is that I don't recursively have to download all the folders under the project (DiffHand/pybind11),also lack of the package of libXxf86vm.After downloading the relevant files, re-run the setup.py and it will work fine. I hope that helps.

eanswer commented 8 months ago

@Navneet-Kaur21 Let me know if the issue has been successfully solved by recursively cloning the project as mentioned by @Runze-Zhao so that I can close the issue.

LZC0113 commented 6 months ago

Hello, I have run into the same issue. I cannot even install the 'redmax_py' pkg.

LZC0113 commented 6 months ago

Hello, I have run into the same issue. I cannot even install the 'redmax_py' pkg.

I solve the problem by rebuilding the environment and now it works lol. Some packages must be missing when first time install the env.

cidxb commented 3 months ago

I ran into the same problem too.

First of all, i was using the docker image, since i got trouble by installation on cd core python setup.py install So i running it on the docker image instead.

And I after I got in the image, i used pip install -e . in the path /DiffHand/core/ . I don't know if it is right practice, since if i not install it, I can't import it in the python environment or find

Then there will be Preparing metadata (setup.py) ... done Installing collected packages: redmax-py Running setup.py develop for redmax-py and

Installing collected packages: redmax-py
Running setup.py develop for redmax-py
Successfully installed redmax-py

Then if i enter python into the python command line, i can _successfully import redmaxpy. But if I run the example script, the same old ModuleNotFoundError: No module named 'redmax_py' error will appear. So i import os, use commend line path=os.path.abspath(redmax_py.__file__) print(path) And it shows _/workspace/DiffHand/core/redmax_py.cpython-37m-x86_64-linux-gnu.so_

It this in order? So the solution maybe add this path into the package searching path or environment path?

Also I found that in the image, the package actually installed in the following path:

/usr/lib/python3.7/site-packages# ls
easy-install.pth  redmax_py-0.0.1-py3.7-linux-x86_64.egg

But the rest of the pip and the using python is from

/usr/bin/python
/usr/local/bin/pip