isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.39k stars 2.3k forks source link

Error importing Open3d in ubuntu 18.04 (ARM) #841

Closed nitishwadne closed 4 years ago

nitishwadne commented 5 years ago

I have build open3d library from source it builds sucessfully but when i try to import in python 3.6.7 or in python 2.7 it is giving error like "ModuleNotFoundError: No module named 'open3d'". I have also tried to install open3d using python package sudo -H pip install open3d-python. It installed successfully but when i tried to import the open3d it is giving error like ImportError: /usr/local/lib/python2.7/dist-packages/open3d/linux/open3d.so: cannot open shared object file: No such file or directory. I am using ubuntu 18.04

yxlao commented 5 years ago

First,we recommend using virtualenvs or conda, this will elimiate the need for sudo.

When building from srouce, make sure that the python interpreter you used at config time cmake .. is the same as one as you use after the installation. You can do this explicitly, e.g.

conda activate my_env
which python # this shall print the current python binary
cmake -DPYTHON_EXECUTABLE=`which python` .. # the python path will be printed in cmake messages
make install-pip-package -j8
python -c "import open3d; print(open3d)"

If you install from pip, make sure the latest version is retrived. First, clean up the previous installation, and try to force a update, for example:

pip install open3d-python -U --no-cache-dir

The error ImportError: /usr/local/lib/python2.7/dist-packages/open3d/linux/open3d.so looks like it's using an old (<0.3.0) Open3D version.

nitishwadne commented 5 years ago

I have created a virtual environment. and tried to install using "pip install open3d-python -U --no-cache-dir" I am using open-3d version 0.3.0.0

``pi@NanoPi-M4:~/Environments$ source open3dProject_py27/bin/activate (open3dProject_py27) pi@NanoPi-M4:~/Environments$ pip install open3d-python -U --no-cache-dir DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Collecting open3d-python Downloading https://files.pythonhosted.org/packages/df/e8/6497d43442f5ff0da42c1f3f2db075e10a87cadedd0cd23150443708def1/open3d_python-0.3.0.0-py2.py3-none-any.whl (17.2MB) 100% |████████████████████████████████| 17.2MB 140kB/s Collecting numpy (from open3d-python) Downloading https://files.pythonhosted.org/packages/2b/26/07472b0de91851b6656cbc86e2f0d5d3a3128e7580f23295ef58b6862d6c/numpy-1.16.1.zip (5.1MB) 100% |████████████████████████████████| 5.1MB 173kB/s Installing collected packages: numpy, open3d-python Running setup.py install for numpy ... done Successfully installed numpy-1.16.1 open3d-python-0.3.0.0 (open3dProject_py27) pi@NanoPi-M4:~/Environments$ python Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import open3d Traceback (most recent call last): File "", line 1, in File "/home/pi/Environments/open3dProject_py27/lib/python2.7/site-packages/open3d/init.py", line 9, in from open3d.linux import * File "/home/pi/Environments/open3dProject_py27/lib/python2.7/site-packages/open3d/linux/init.py", line 7, in globals().update(importlib.import_module('open3d.linux.open3d').dict) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: /home/pi/Environments/open3dProject_py27/lib/python2.7/site-packages/open3d/linux/open3d.so: cannot open shared object file: No such file or directory

Is it related to arm architecture as i am using nano pi M4.

nitishwadne commented 5 years ago

@yxlao i am providing my virtual environment details as Package Version


numpy 1.16.1 open3d-python 0.3.0.0 pip 19.0.3 setuptools 40.8.0 wheel 0.33.1

yxlao commented 5 years ago

Yeah, that shall be the reason. PyPI detects the system's platform. As you can see from here, Open3D is pre-compiled for x86 architecture only. For example, we have a x86_64 tag in the file name open3d_python-0.5.0.0-cp27-cp27mu-manylinux1_x86_64.whl. On ARM, pip will try to find a compatible version, it happens that Open3D 0.3.0 doesn't have a tag specifying the platform version. Therefore pip thinks that 0.3.0 pre-compiled package is compatible with ARM, but in fact, it is not.

The solution is to compile Open3D from source. Seems that Open3D is working on Nvidia Jetson TX2. One possible difference is that Nvidia Jetson TX2 seems to support both OpenGL and OpenGL ES, but Nano pi M4 only support OpenGL ES. Open3D currently uses OpenGL (not ES) for visualization, so the visualizer might not work on your board. You're welcome to try and If you get it working please let us know or submit a patch.

nitishwadne commented 5 years ago

I have installed open3d 0.5.0.0 but still it is giving me same error. Can i use intel Up squared board or any other single computer board that you want to recommend. i have tried it on Raspberry pi 3 it is #789 error. Can i use with raspberry pi and windows 10 installed on it. please suggest.

yxlao commented 5 years ago

Boards like LattePanda with Intel CPUs shall work, but they are more expensive. Currently, Open3D has not been fully tested on single-board (ARM) computers. I am guessing most parts shall work, maybe with the exception of the visualizer.

nitishwadne commented 5 years ago

Intel's UP2 board is based on x86 arhitecture can i use it with open3d.

syncle commented 4 years ago

Closing due to inactivity.

star0w commented 2 years ago

Boards like LattePanda with Intel CPUs shall work, but they are more expensive. Currently, Open3D has not been fully tested on single-board (ARM) computers. I am guessing most parts shall work, maybe with the exception of the visualizer.

hi I wonder if open3D can work with the arm architecture, python2. I didn't find some files available in https://pypi.org/project/open3d/0.9.0.0/#files. thx!