Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pip install on Mac M1 #6492

Open
3 tasks done
jenngrannen opened this issue Nov 14, 2023 · 6 comments
Open
3 tasks done

Cannot pip install on Mac M1 #6492

jenngrannen opened this issue Nov 14, 2023 · 6 comments
Labels

Comments

@jenngrannen
Copy link

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

  • Operating system: macOS 13.4.1
  • Python version: Tried both Python 3.8 and 3.10
  • Open3D version: 0.17.0 and 0.16.0
  • System architecture: x86_64
  • Is this a remote workstation?: no
  • How did you install Open3D?: pip

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
Copy link

hopezh commented Nov 19, 2023

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
Copy link

Galsor commented Dec 7, 2023

Same issue with Mac M3

@MrBenGriffin
Copy link

... 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
Copy link
Member

ssheorey commented Jan 5, 2024

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
Copy link
Member

ssheorey commented Jan 5, 2024

... 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
Copy link
Member

ssheorey commented Jan 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants