Skip to content
New issue

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

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

Already on GitHub? # to your account

can't install pymatgen==2023.2.28 on Apple Silicon. #3521

Closed
KatiGithub opened this issue Dec 16, 2023 · 3 comments · Fixed by nomad-coe/nomad#91
Closed

can't install pymatgen==2023.2.28 on Apple Silicon. #3521

KatiGithub opened this issue Dec 16, 2023 · 3 comments · Fixed by nomad-coe/nomad#91
Labels
awaiting user Needs more information from OP. compatability Concerning pymatgen compatibility with different OS, Python versions, numpy versions, etc. install Installation issues

Comments

@KatiGithub
Copy link

KatiGithub commented Dec 16, 2023

Because of a project, I require specifically pymatgen version 2023.2.28.

Specs:
Apple M1 Pro
Python v3.10

The installation process keeps failing at the "building wheel" stage with this error output.

Error compiling Cython file:
  ------------------------------------------------------------
  ...
      #ensure correct shape
      fcoords1, fcoords2 = np.atleast_2d(fcoords1, fcoords2)
  
      pbc = lattice.pbc
      cdef int n_pbc = sum(pbc)
      cdef int n_pbc_im = 3 ** n_pbc
                            ^
  ------------------------------------------------------------
  
  pymatgen/util/coord_cython.pyx:93:26: Cannot assign type 'double' to 'int'
  Compiling pymatgen/util/coord_cython.pyx because it changed.
  [1/1] Cythonizing pymatgen/util/coord_cython.pyx
  Traceback (most recent call last):
    File "/Volumes/dev/apps.bin/anaconda3/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Volumes/DATA/dev/apps.bin/anaconda3/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Volumes/DATA/dev/apps.bin/anaconda3/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 404, in build_wheel
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 389, in _build_with_temp_dir
      self.run_setup()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 26, in <module>
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/normal/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 368, in run
      self.run_command("build")
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 131, in run
      self.run_command(cmd_name)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 963, in run_command
      super().run_command(command)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 88, in run
      _build_ext.run(self)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
      self.build_extensions()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
      self._build_extensions_serial()
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
      self.build_extension(ext)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
      _build_ext.build_extension(self, ext)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/Cython/Distutils/build_ext.py", line 130, in build_extension
      new_ext = cythonize(
                ^^^^^^^^^^
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "/private/var/folders/hg/286ym9wj2s1cydsd33_yct7w0000gn/T/pip-build-env-asx1ygx4/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: pymatgen/util/coord_cython.pyx
  [end of output]
@janosh
Copy link
Member

janosh commented Dec 20, 2023

Any reason you need to install 2023.2.28, an outdated version?

@janosh janosh added awaiting user Needs more information from OP. compatability Concerning pymatgen compatibility with different OS, Python versions, numpy versions, etc. install Installation issues labels Dec 20, 2023
@KatiGithub
Copy link
Author

Any reason you need to install 2023.2.28, an outdated version?

The latest version of "nomad-lab" requires it.

@janosh
Copy link
Member

janosh commented Dec 20, 2023

@KatiGithub nomad-coe/nomad#91 may solve that issue. Feel free to report back here if that's not the case.

@janosh janosh closed this as completed Dec 20, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
awaiting user Needs more information from OP. compatability Concerning pymatgen compatibility with different OS, Python versions, numpy versions, etc. install Installation issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants