isl-org / isl-org/Open3D

Open3d 0.16.1 fails to install correct dependencies under Poetry

Open
#5,747 15 comments 2 reactions 0 assignees View on GitHub
build/install
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Steps to reproduce the issue

Create a `pyproject.toml` file:

```toml
[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10, <3.11"
open3d = "0.16.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
```

Run:

```
poetry lock
poetry install --sync
poetry shell
```

Note that the way this mac-only package was published, it is missing ML-related dependencies in how Poetry pulls dependencies through the API:

```
pip list
Package Version
-------------------- -------
attrs 22.1.0
click 8.1.3
ConfigArgParse 1.5.3
dash 2.7.0
dash-core-components 2.0.0
dash-html-components 2.0.0
dash-table 5.0.0
fastjsonschema 2.16.2
Flask 2.2.2
itsdangerous 2.1.2
Jinja2 3.1.2
jsonschema 4.17.3
jupyter_core 5.1.0
MarkupSafe 2.1.1
nbformat 5.5.0
numpy 1.23.5
open3d 0.16.1
pip 22.3.1
platformdirs 2.5.4
plotly 5.11.0
pyrsistent 0.19.2
setuptools 65.6.3
tenacity 8.1.0
traitlets 5.6.0
Werkzeug 2.2.2
wheel 0.38.4
```

For example, `scikit-learn` is not installed even though it is a dependency.

### Error message

Within the `poetry shell`:

```
$ python
Python 3.10.8 (main, Oct 13 2022, 10:17:43) [Clang 14.0.0 (clang-1400.0.29.102)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import open3d
Traceback (most recent call last):
File "", line 1, in
File "/Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.10/lib/python3.10/site-packages/open3d/__init__.py", line 134, in
import open3d.ml
File "/Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.10/lib/python3.10/site-packages/open3d/ml/__init__.py", line 35, in
from . import datasets
File "/Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.10/lib/python3.10/site-packages/open3d/ml/datasets.py", line 34, in
from open3d._ml3d.datasets import *
File "/Users/hagenjt1/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.10/lib/python3.10/site-packages/open3d/_ml3d/datasets/__init__.py", line 3, in
from .semantickitti import SemanticKITTI
File "/Users/user/Library/Caches/pypoetry/virtualenvs/poetry-test-hz2NYSp8-py3.10/lib/python3.10/site-packages/open3d/_ml3d/datasets/semantickitti.py", line 6, in
from sklearn.neighbors import KDTree
ModuleNotFoundError: No module named 'sklearn'
```

### Open3D, Python and System information

```markdown
- Operating system: macOS 12.6
- Python version: Python 3.10.8
- Open3D version: 0.16.1
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: Poetry
- Compiler version (if built from source): N/A
```

### Additional information

Discussion with Poetry devs about this topic:

- https://github.com/orgs/python-poetry/discussions/7128

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.