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

could not import redmax_py #5

Open
Navneet-Kaur21 opened this issue Nov 17, 2023 · 23 comments
Open

could not import redmax_py #5

Navneet-Kaur21 opened this issue Nov 17, 2023 · 23 comments

Comments

@Navneet-Kaur21
Copy link

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
Copy link
Owner

eanswer commented Nov 17, 2023

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
Copy link
Author

Navneet-Kaur21 commented Nov 17, 2023 via email

@Navneet-Kaur21
Copy link
Author

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

@Navneet-Kaur21
Copy link
Author

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

@eanswer
Copy link
Owner

eanswer commented Nov 17, 2023

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
Copy link
Author

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

@eanswer
Copy link
Owner

eanswer commented Nov 17, 2023

I see, could you check two things for me:

  1. Which python path you are using, run below in terminal
which python
  1. Check whether redmax_py is installed in your conda environment:
pip list | grep redmax-py

@eanswer
Copy link
Owner

eanswer commented Nov 17, 2023

May be also which pip

@Navneet-Kaur21
Copy link
Author

  1. /home/anaconda3/bin/python
  2. returns nothing.
  3. /home/anaconda3/bin/pip

@eanswer
Copy link
Owner

eanswer commented Nov 17, 2023

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

@Navneet-Kaur21
Copy link
Author

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
Copy link
Owner

eanswer commented Nov 17, 2023

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
Copy link
Author

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
Copy link
Owner

eanswer commented Nov 17, 2023

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

@Navneet-Kaur21
Copy link
Author

Navneet-Kaur21 commented Nov 17, 2023

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
Copy link

I have run into the same issue

@Navneet-Kaur21
Copy link
Author

Navneet-Kaur21 commented Nov 21, 2023

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

I have run into the same issue

@Navneet-Kaur21
Copy link
Author

Navneet-Kaur21 commented Nov 22, 2023

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
Copy link

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
Copy link
Owner

eanswer commented Jan 15, 2024

@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
Copy link

LZC0113 commented Mar 8, 2024

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

@LZC0113
Copy link

LZC0113 commented Mar 8, 2024

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
Copy link

cidxb commented Jun 13, 2024

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 redmax_py. 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

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

5 participants