isl-org / Open3D

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

Unable to import open3d on python 3.8 in Pycharm #3242

Closed ghost closed 3 years ago

ghost commented 3 years ago

IMPORTANT: Please use the following template to report the bug.


Describe the bug import open3d doesn't work

To Reproduce Steps to reproduce the behavior:

  1. import open3d
  2. run
  3. See error
    /home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    import imp
    Traceback (most recent call last):
    File "/home/muhammadmehdi/PycharmProjects/memex/create_ptcloud_plot.py", line 1, in <module>
    import open3d
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/open3d/__init__.py", line 103, in <module>
    import open3d.ml
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/open3d/ml/__init__.py", line 35, in <module>
    from . import datasets
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/open3d/ml/datasets.py", line 34, in <module>
    from open3d._ml3d.datasets import *
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/open3d/_ml3d/datasets/__init__.py", line 5, in <module>
    from .semantickitti import SemanticKITTI
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/open3d/_ml3d/datasets/semantickitti.py", line 6, in <module>
    from sklearn.neighbors import KDTree
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/__init__.py", line 64, in <module>
    from .base import clone
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/base.py", line 13, in <module>
    from .utils.fixes import signature
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/utils/__init__.py", line 13, in <module>
    from .validation import (as_float_array,
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/utils/validation.py", line 27, in <module>
    from ..utils._joblib import Memory
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/utils/_joblib.py", line 18, in <module>
    from ..externals.joblib import __all__   # noqa
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/__init__.py", line 119, in <module>
    from .parallel import Parallel
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/parallel.py", line 32, in <module>
    from .externals.cloudpickle import dumps, loads
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/__init__.py", line 3, in <module>
    from .cloudpickle import *
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py", line 151, in <module>
    _cell_set_template_code = _make_cell_set_template_code()
    File "/home/muhammadmehdi/PycharmProjects/memex/venv/lib/python3.8/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py", line 132, in _make_cell_set_template_code
    return types.CodeType(
    TypeError: an integer is required (got type bytes)

Expected behavior import open3d should work without error

Environment (please complete the following information):

Additional context I am using the Pycharm IDE

ghost commented 3 years ago

I solved this problem by building open3d from source: http://www.open3d.org/docs/release/compilation.html