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

python pangolin install #916

Closed
twistxj opened this issue Mar 29, 2024 · 5 comments
Closed

python pangolin install #916

twistxj opened this issue Mar 29, 2024 · 5 comments

Comments

@twistxj
Copy link

twistxj commented Mar 29, 2024

i'm having trouble installing the python pangolin component. When I run: cmake --build build -t pypangolin_pip_install

It goes through most of the steps and then says this at the end:

Successfully installed numpy-1.26.4 pillow-10.2.0 pybind11-2.12.0 pyopengl-3.1.7 pyopengl-accelerate-3.1.7 pypangolin-0.9.1
WARNING: Skipping M:\gitRepos\Pangolin\build\pypangolin-0.9.1.dist-info due to invalid metadata entry 'name'
WARNING: Skipping M:\gitRepos\Pangolin\build\pypangolin-0.9.1.dist-info due to invalid metadata entry 'name'
WARNING: Skipping M:\gitRepos\Pangolin\build\pypangolin-0.9.1.dist-info due to invalid metadata entry 'name'

I can't run any of the python examples so I don't think it installed correctly. Any thoughts?

@twistxj
Copy link
Author

twistxj commented Mar 29, 2024

this is how the build outputs:

$ cmake -B build -GNinja
-- The C compiler identification is GNU 13.1.0
-- The CXX compiler identification is GNU 13.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Strawberry/c/bin/gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Strawberry/c/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Found Eigen: 'M://include/eigen3'
CMake Deprecation Warning at components/pango_python/pybind11/CMakeLists.txt:8 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- pybind11 v2.10.2
-- pybind11::lto disabled (problems with undefined symbols for MinGW for now)
-- pybind11::thin_lto disabled (problems with undefined symbols for MinGW for now)
-- Selected Python: 'C:/Users/olive_000/AppData/Local/Programs/Python/Python312/python.exe'. cmake --build . -t pypangolin_pip_install to use pypangolin module.
-- Found PkgConfig: C:/pkgconf/bin/pkg-config.exe (found version "0.26")
-- Configuring done (3.8s)
-- Generating done (0.1s)
-- Build files have been written to: M:/gitRepos/Pangolin/build

@christian-rauch
Copy link
Collaborator

It looks like you are using Windows. Note the information in the README about the Python bindings:

NOTE The python wheel and install targets are only currently working on MacOS and Linux. On Windows, you're out of luck right now. Help appreciated!

So you may just be out of luck on Windows.

Nevertheless, I am checking now that cmake --build build -t pypangolin_wheel works in the CI (#918) and I can run the SimpleDisplay.py example (python ./examples/PythonExamples/SimpleDisplay.py).

Can you provide details on what is not working?

@christian-rauch christian-rauch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 17, 2024
@weixr18
Copy link

weixr18 commented Nov 14, 2024

So sad TvT I wish I could see this issue earlier(and read README more carefully!!!), or I won't spend a whole day wondering why Windows+MinGW+pypangolin would fail.

I managed to solve all the compiling problems and got executable dlls, with perfect running example exes, but the .pyd just doesn't work.

>>> import pypangolin
>>> import pypangolin
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 ImportError: DLL load failed while importing pypangolin: The specified module could not be found. 

Moreover, I tried to analysis the dependencies a/o symbols with MinGW commands ldd nm and strings. Here's what I got.

$ ldd pypangolin.cp312-win_amd64.pyd
ldd: pypangolin.cp312-win_amd64.pyd: Exec format error

$ nm pypangolin.cp312-win_amd64.pyd
E:\OPEN\GCC\mingw-w64-x86_64-8.1.0\bin\nm.exe: pypangolin.cp312-win_amd64.pyd: no symbols

$ strings pypangolin.cp312-win_amd64.pyd | grep dll
python312.dll
glew32.dll
libgcc_s_seh-1.dll
KERNEL32.dll
msvcrt.dll
OPENGL32.dll
libwinpthread-1.dll
libstdc++-6.dll
libpango_core.dll
libpango_display.dll
libpango_image.dll
libpango_opengl.dll
libpango_plot.dll
libpango_vars.dll
libpango_video.dll

Hope no one else would repeat my tragedy [Facepalm]

@christian-rauch
Copy link
Collaborator

christian-rauch commented Nov 14, 2024

So sad TvT I wish I could see this issue earlier(and read README more carefully!!!), or I won't spend a whole day wondering why Windows+MinGW+pypangolin would fail.

Actually, it should work now. I haven't tried this myself on an actual Windows installation, but since #960, we install and run the Python wheel in the CI. See https://github.com/stevenlovegrove/Pangolin/actions/runs/11627142146/job/32379980092.

I managed to solve all the compiling problems and got executable dlls, with perfect running example exes, but the .pyd just doesn't work.

>>> import pypangolin
>>> import pypangolin
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 ImportError: DLL load failed while importing pypangolin: The specified module could not be found. 

Moreover, I tried to analysis the dependencies a/o symbols with MinGW commands ldd nm and strings. Here's what I got.

$ ldd pypangolin.cp312-win_amd64.pyd
ldd: pypangolin.cp312-win_amd64.pyd: Exec format error

$ nm pypangolin.cp312-win_amd64.pyd
E:\OPEN\GCC\mingw-w64-x86_64-8.1.0\bin\nm.exe: pypangolin.cp312-win_amd64.pyd: no symbols

$ strings pypangolin.cp312-win_amd64.pyd | grep dll
python312.dll
glew32.dll
libgcc_s_seh-1.dll
KERNEL32.dll
msvcrt.dll
OPENGL32.dll
libwinpthread-1.dll
libstdc++-6.dll
libpango_core.dll
libpango_display.dll
libpango_image.dll
libpango_opengl.dll
libpango_plot.dll
libpango_vars.dll
libpango_video.dll

Hope no one else would repeat my tragedy [Facepalm]

If you link dynamically, you may have to tell the Python interpreter where to find the libraries. The CI only tests the Windows wheel file only for static linking (´-D BUILD_SHARED_LIBS=OFF´), to avoid this.

@weixr18
Copy link

weixr18 commented Nov 29, 2024

So sad TvT I wish I could see this issue earlier(and read README more carefully!!!), or I won't spend a whole day wondering why Windows+MinGW+pypangolin would fail.

Actually, it should work now. I haven't tried this myself on an actual Windows installation, but since #960, we install and run the Python wheel in the CI. See https://github.com/stevenlovegrove/Pangolin/actions/runs/11627142146/job/32379980092.

I managed to solve all the compiling problems and got executable dlls, with perfect running example exes, but the .pyd just doesn't work.

>>> import pypangolin
>>> import pypangolin
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 ImportError: DLL load failed while importing pypangolin: The specified module could not be found. 

Moreover, I tried to analysis the dependencies a/o symbols with MinGW commands ldd nm and strings. Here's what I got.

$ ldd pypangolin.cp312-win_amd64.pyd
ldd: pypangolin.cp312-win_amd64.pyd: Exec format error

$ nm pypangolin.cp312-win_amd64.pyd
E:\OPEN\GCC\mingw-w64-x86_64-8.1.0\bin\nm.exe: pypangolin.cp312-win_amd64.pyd: no symbols

$ strings pypangolin.cp312-win_amd64.pyd | grep dll
python312.dll
glew32.dll
libgcc_s_seh-1.dll
KERNEL32.dll
msvcrt.dll
OPENGL32.dll
libwinpthread-1.dll
libstdc++-6.dll
libpango_core.dll
libpango_display.dll
libpango_image.dll
libpango_opengl.dll
libpango_plot.dll
libpango_vars.dll
libpango_video.dll

Hope no one else would repeat my tragedy [Facepalm]

If you link dynamically, you may have to tell the Python interpreter where to find the libraries. The CI only tests the Windows wheel file only for static linking (´-D BUILD_SHARED_LIBS=OFF´), to avoid this.

Thanks! After that I changed to a "regular" dev set of ubuntu 20.04 and everything just goes well. I 'll check the windows solution later ^_^

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

No branches or pull requests

3 participants