isl-org / Open3D

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

Cannot pip install on Mac M1 #6492

Open jenngrannen opened 11 months ago

jenngrannen commented 11 months ago

Checklist

My Question

I've tried to install with pip install open3d, but I get the following error:

ERROR: Could not find a version that satisfies the requirement open3d (from versions: none)
ERROR: No matching distribution found for open3d

System Information

I've also tried installing from the PyPi wheels, but I get errors like this:

ERROR: open3d-0.17.0-cp310-cp310-macosx_11_0_x86_64.whl is not a supported wheel on this platform.
hopezh commented 11 months ago

same here.

My error message:

pip install open3d-0.17.0-cp310-cp310-macosx_13_0_arm64.whl

DEPRECATION: Loading egg at /opt/homebrew/Cellar/gpgme/1.22.0/lib/python3.11/site-packages/gpg-1.22.0-py3.11-macosx-14-arm64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
ERROR: open3d-0.17.0-cp310-cp310-macosx_13_0_arm64.whl is not a supported wheel on this platform.
Galsor commented 10 months ago

Same issue with Mac M3

MrBenGriffin commented 9 months ago

... and one cannot compile from source. The following files need to be fixed cpp/open3d/pipelines/registration/Feature.cpp

-    const int kMaxThreads = utility::EstimateMaxThreads();
-
-    const int kOuterThreads = std::min(kMaxThreads, num_searches);
-    const int kInnerThreads = std::max(kMaxThreads / num_searches, 1);
-#pragma omp parallel for num_threads(kOuterThreads)
+#pragma omp parallel for num_threads(std::min(utility::EstimateMaxThreads(), num_searches))
     for (int k = 0; k < num_searches; ++k) {
         geometry::KDTreeFlann kdtree(features[1 - k]);

         int num_pts_k = num_pts[k];
         corres[k] = CorrespondenceSet(num_pts_k);
-#pragma omp parallel for num_threads(kInnerThreads)
+#pragma omp parallel for num_threads(std::max(utility::EstimateMaxThreads() / num_searches, 1))
         for (int i = 0; i < num_pts_k; i++) {
             std::vector<int> corres_tmp(1);
             std::vector<double> dist_tmp(1);
cpp/open3d/t/pipelines/registration/Feature.cpp 
-    const int kMaxThreads = utility::EstimateMaxThreads();
-    const int kOuterThreads = std::min(kMaxThreads, num_searches);
-
     // corres[0]: corres_ij, corres[1]: corres_ji
-#pragma omp parallel for num_threads(kOuterThreads)
+#pragma omp parallel for num_threads(std::min(utility::EstimateMaxThreads(), num_searches))
     for (int i = 0; i < num_searches; ++i) {
         core::nns::NearestNeighborSearch nns(features[1 - i],
                                              core::Dtype::Int64);
cpp/open3d/utility/FileSystem.cpp 
-#include <experimental/filesystem>
-namespace fs = std::experimental::filesystem;
+#include <filesystem>
+namespace fs = std::__fs::filesystem;

One needs to build+install (separately from their GitHub) PyBind11: The source currently shipping with Open3D is broken.

Again with filament - then, because the CMAKE flags fail to recognise the filament build directory, on needs to ln-s the two filament directories accordingly in the build directory. Assuming Open3D are both under ~/Documents/3rdPty

ln -s ~/Documents/3rdPty/filament/out/release/filament ~/Documents/3rdPty/Open3D/build/filament-binaries 
ln -s ~/Documents/3rdPty/filament ~/Documents/3rdPty/Open3D/build/filament/src/ext_filament

The GUI build fails completely - it seems to be trying to build/include filament stuff but not invoking c++17 or greater. So ..

cd Open3D/build
cmake -D CMAKE_CXX_FLAGS="-Wno-unused-variable -Wno-deprecated" -DUSE_SYSTEM_PYBIND11=ON -DBUILD_GUI=OFF ..
make -j20  
# j20 uses the cores you have available - so it may be less or more.

make -j20  python-package
pip3 install wheel setuptools
make install-pip-package
make pip-package
ssheorey commented 9 months ago

same here.

My error message:

pip install open3d-0.17.0-cp310-cp310-macosx_13_0_arm64.whl

DEPRECATION: Loading egg at /opt/homebrew/Cellar/gpgme/1.22.0/lib/python3.11/site-packages/gpg-1.22.0-py3.11-macosx-14-arm64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330
ERROR: open3d-0.17.0-cp310-cp310-macosx_13_0_arm64.whl is not a supported wheel on this platform.

Something is wrong with your Python installation - you are trying to install a Python 3.10 wheel but using a python 3.11 environment (from homebrew).

ssheorey commented 9 months ago

... and one cannot compile from source. The following files need to be fixed cpp/open3d/pipelines/registration/Feature.cpp

-    const int kMaxThreads = utility::EstimateMaxThreads();
-
-    const int kOuterThreads = std::min(kMaxThreads, num_searches);
-    const int kInnerThreads = std::max(kMaxThreads / num_searches, 1);
-#pragma omp parallel for num_threads(kOuterThreads)
+#pragma omp parallel for num_threads(std::min(utility::EstimateMaxThreads(), num_searches))
     for (int k = 0; k < num_searches; ++k) {
         geometry::KDTreeFlann kdtree(features[1 - k]);

         int num_pts_k = num_pts[k];
         corres[k] = CorrespondenceSet(num_pts_k);
-#pragma omp parallel for num_threads(kInnerThreads)
+#pragma omp parallel for num_threads(std::max(utility::EstimateMaxThreads() / num_searches, 1))
         for (int i = 0; i < num_pts_k; i++) {
             std::vector<int> corres_tmp(1);
             std::vector<double> dist_tmp(1);
cpp/open3d/t/pipelines/registration/Feature.cpp 
-    const int kMaxThreads = utility::EstimateMaxThreads();
-    const int kOuterThreads = std::min(kMaxThreads, num_searches);
-
     // corres[0]: corres_ij, corres[1]: corres_ji
-#pragma omp parallel for num_threads(kOuterThreads)
+#pragma omp parallel for num_threads(std::min(utility::EstimateMaxThreads(), num_searches))
     for (int i = 0; i < num_searches; ++i) {
         core::nns::NearestNeighborSearch nns(features[1 - i],
                                              core::Dtype::Int64);
cpp/open3d/utility/FileSystem.cpp 
-#include <experimental/filesystem>
-namespace fs = std::experimental::filesystem;
+#include <filesystem>
+namespace fs = std::__fs::filesystem;

One needs to build+install (separately from their GitHub) PyBind11: The source currently shipping with Open3D is broken.

Again with filament - then, because the CMAKE flags fail to recognise the filament build directory, on needs to ln-s the two filament directories accordingly in the build directory. Assuming Open3D are both under ~/Documents/3rdPty

ln -s ~/Documents/3rdPty/filament/out/release/filament ~/Documents/3rdPty/Open3D/build/filament-binaries 
ln -s ~/Documents/3rdPty/filament ~/Documents/3rdPty/Open3D/build/filament/src/ext_filament

The GUI build fails completely - it seems to be trying to build/include filament stuff but not invoking c++17 or greater. So ..

cd Open3D/build
cmake -D CMAKE_CXX_FLAGS="-Wno-unused-variable -Wno-deprecated" -DUSE_SYSTEM_PYBIND11=ON -DBUILD_GUI=OFF ..
make -j20  
# j20 uses the cores you have available - so it may be less or more.

make -j20  python-package
pip3 install wheel setuptools
make install-pip-package
make pip-package

We haven't been able to reproduce these issues on macOS Apple Si. If you are seeing them on your machine and have a fix, please submit a PR so we can test and merge.

ssheorey commented 9 months ago

Please try pip install open3d with the new version 0.18. It is available for Apple Si for Python 3.8-3.11.