pytorch3d icon indicating copy to clipboard operation
pytorch3d copied to clipboard

Import form pip install vs local install

Open ghost opened this issue 6 years ago • 3 comments

Hi, I wanna ask how to import pytorch3d after the local install.

When I install by

!git clone https://github.com/facebookresearch/pytorch3d.git
!cd pytorch3d && pip install -e .

and using this quoto

from pytorch3d.io import load_obj, save_obj

it returns

ModuleNotFoundError: No module named 'pytorch3d.io'

then I change it to image

it returns image

how to redirect all pytorch3d path to correct pah or are there any way to solve it

ghost avatar Mar 05 '20 07:03 ghost

Could it be that the command !cd pytorch3d && pip install -e . failed? What was its output? I think you haven't successfully built/installed pytorch3d, and it can just see the files in the working directory. This means that (whether or not there are path issues) you won't have access to the compiled parts of pytorch3d.

bottler avatar Mar 05 '20 11:03 bottler

@shihfangchen did you check the installation was completed correctly? If you don't need help anymore please close this issue.

nikhilaravi avatar Mar 17 '20 19:03 nikhilaravi

Hi, I wanted to mention that I had this error and realized it was because I named my script pytorch3d.py -- so even though everything was installed properly python was trying to resolve pytorch3d.io based on the filename of the script itself. 😬

In the case above it looks like the folder name of the project is pytorch3d/, so the script is trying to resolve from there (e.g. why pytorch3d.pytorch3d works) and then hitting various name collisions, since pytorch3d will still refer to the base folder.

Just in case that helps anyone in the future.

jmagoon avatar Sep 24 '20 22:09 jmagoon