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

[Bug]: v2023.9.25 pip install fail on MacOS (in specific cases) #3348

Closed
amkrajewski opened this issue Sep 25, 2023 · 5 comments · Fixed by #3352
Closed

[Bug]: v2023.9.25 pip install fail on MacOS (in specific cases) #3348

amkrajewski opened this issue Sep 25, 2023 · 5 comments · Fixed by #3352

Comments

@amkrajewski
Copy link
Contributor

Hi! I noticed that the just-released pymatgen v2023.9.25 in this specific configuration cannot pip install correctly on MacOS X86_64 GitHub runner for Python 3.9 and Python 3.10, but can for Python 3.11.

Notes:

  • Issue re-occurs when workflow is re-run.
  • Issue does not occur on Linux (Ubuntu).
  • Installs correctly under v2023.9.10 on the same system.
  • The only other dependency alongside it is rpy2>3.5.0. With rpy2==3.5.14, all dependency versions seem satisfied.
  • It seems to be numpy-related. I attach a relevant snippet at the end. Full log is here.
  • When I tested 3 other packages that do not use rpy2, v2023.9.25 installs as usual.
Compiling pymatgen/optimization/linear_assignment.pyx because it changed.
      [1/1] Cythonizing pymatgen/optimization/linear_assignment.pyx
      building 'pymatgen.optimization.linear_assignment' extension
      creating build/temp.macosx-11.7-x86_64-cpython-310
      creating build/temp.macosx-11.7-x86_64-cpython-310/pymatgen
      creating build/temp.macosx-11.7-x86_64-cpython-310/pymatgen/optimization
      gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/opt/sqlite/include -I/usr/local/opt/sqlite/include -I/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-1za7ze_a/overlay/lib/python3.10/site-packages/numpy/core/include -I/Users/runner/hostedtoolcache/Python/3.10.13/x64/include/python3.10 -c pymatgen/optimization/linear_assignment.c -o build/temp.macosx-11.7-x86_64-cpython-310/pymatgen/optimization/linear_assignment.o
      <built-in>: error: unknown value ‘11.7’ of -mmacosx-version-min
      In file included from /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-1za7ze_a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969,
                       from /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-1za7ze_a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                       from /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-1za7ze_a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                       from pymatgen/optimization/linear_assignment.c:1167:
      /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-1za7ze_a/overlay/lib/python3.10/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       #warning "Using deprecated NumPy API, disable it with " \
        ^~~~~~~
      error: command '/usr/local/gfortran/bin/gcc' failed with exit code 1
      [end of output]

Have a lovely day!
Adam

@shyuep
Copy link
Member

shyuep commented Sep 25, 2023

Hmm... the error suggests it is a problem with your gcc and not pymatgen? I just installed it on my mac and there were no issues. Also, your numpy seems to be really old. I would upgrade numpy first using pip install --upgrade numpy.

@amkrajewski
Copy link
Contributor Author

The above occurred with numpy-1.26.0-cp39-cp39-macosx_10_9_x86_64, from a week ago, installed earlier in the workflow run. Environment is a clean GitHub macos-latest runner with default configuration.

@shyuep
Copy link
Member

shyuep commented Sep 25, 2023

We are running CI on the same environment. You can check it out in the Actions tab. There is no issue on our end. I guess the question is whether rpy is installing something that conflicts with the pymatgen requirements.

@amkrajewski
Copy link
Contributor Author

Right! I checked first to see if your tests were passing. On my side, all of my other packages utilizing pymatgen, but not rpy2, have passed as well with the new release.

I probably should have been more clear. The reason I brought this up is that this issue seemed to indicate pymatgen's dependencies might be underspecified, allowing for too old Numpy, given changes done in the new release. When installing pymatgen on its own, like in the test matrix, or with other highly-maintained packages, this wouldn't show up, as pip solves for the latest versions of everything, but some other installations might force older versions while still resolving dependencies.

If you think there is no problem, please don't hesitate to close. And big thanks for such a quick response!

@amkrajewski amkrajewski changed the title [Bug]: v2023.9.25 pip install fail on MacOS [Bug]: v2023.9.25 pip install fail on MacOS (in specific cases) Sep 26, 2023
@janosh
Copy link
Member

janosh commented Sep 26, 2023

The reason I brought this up is that this issue seemed to indicate pymatgen's dependencies might be underspecified, allowing for too old Numpy

You're right, we should require the oldest numpy to have 3.9 as oldest supported Python. This appears to be v1.25.0.

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

Successfully merging a pull request may close this issue.

3 participants