Reputation: 11
I have used Spack 0.24.0.dev0 to create an environment that includes Python 3.13.0, and I also used Spack to install several python modules including Cython.
Now I need to install the pytetgen module (https://pypi.org/project/pytetgen/). When I try pip install pytetgen
, however, the installation fails saying it cannot find the Cython module. But I can manually load Cython from within Python. And pip install Cython
correctly tells me the module is already installed. My PYTHONPATH variable also seems to correctly point to the modules installed by spack.
Can anyone please help me troubleshoot the problem further? I am at a loss as are my colleagues.
My spack environment seems to contain the correct python with necessary modules:
$ spack find
==> In environment sierra_gcc
==> 10 root specs
[+] [email protected] [+] py-matplotlib [+] py-pandas [+] py-scikit-learn [+] python
[+] py-cython [+] py-numpy [+] py-pip [+] py-setuptools [+] seacas
-- linux-rhel8-icelake / [email protected] -----------------------------
[email protected] [email protected] parallel@20240822 [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
ca-certificates-mozilla@2023-05-30 [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] seacas@2024-08-15
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected] [email protected]
[email protected] [email protected] [email protected]
[email protected] [email protected] [email protected]
==> 122 installed packages
==> 0 concretized packages to be installed (show with `spack find -c`)
The environment is pointing to the correct python binary:
$ which python
~/spack/var/spack/environments/sierra_gcc/.spack-env/view/bin/python
From within python, I can easily load modules including Cython:
$ python
Python 3.13.0 (main, Dec 3 2024, 14:21:56) [GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from Cython import *
>>>
PYTHONPATH seems to be correct:
$ echo $PYTHONPATH
/home/tvj/spack/var/spack/environments/sierra_gcc/.spack-env/view/lib:/home/tvj/spack/var/spack/environments/sierra_gcc/.spack-env/view/lib/python3.13/site-packages:.
When I try pip install Cython
, it already sees that the module has been installed:
$ pip install Cython
Requirement already satisfied: Cython in ./spack/var/spack/environments/sierra_gcc/.spack-env/view/lib/python3.13/site-packages (3.0.11)
Yet pip install pytetgen
fails to recognize the Cython module:
$ pip install pytetgen
Collecting pytetgen
Using cached pytetgen-0.2.2.tar.gz (409 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
Traceback (most recent call last):
File "/home/tvj/spack/var/spack/environments/sierra_gcc/.spack-env/view/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
main()
~~~~^^
File "/home/tvj/spack/var/spack/environments/sierra_gcc/.spack-env/view/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/tvj/spack/var/spack/environments/sierra_gcc/.spack-env/view/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-yzg25sy8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 334, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-yzg25sy8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 304, in _get_build_requires
self.run_setup()
~~~~~~~~~~~~~~^^
File "/tmp/pip-build-env-yzg25sy8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
super().run_setup(setup_script=setup_script)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-yzg25sy8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
exec(code, locals())
~~~~^^^^^^^^^^^^^^^^
File "<string>", line 5, in <module>
ModuleNotFoundError: No module named 'Cython'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
[notice] A new release of pip is available: 23.1.2 -> 24.3.1
[notice] To update, run: python3 -m pip install --upgrade pip
In my ignorance, I have tried variations including pip3 install pytetgen
, python -m pip install pytetgen
, all with the same error.
This seems like it could be related to: ( pip install can't find a package during build even though it's installed ), however, the workaround of adding setup_requires=['Cython']
did not work for me.
I do note that pytetgen
appears to use distutils
in the setup file. Could this be related to the problem?
Upvotes: 1
Views: 86