nikolasibalic / ARC-Alkali-Rydberg-Calculator

Object-oriented Python library for computation of properties of highly-excited Rydbeg states of alkali and divalent atoms.
https://atomcalc.org
BSD 3-Clause "New" or "Revised" License
90 stars 78 forks source link

Install Issue on MacOS #118

Closed henhen724 closed 2 years ago

henhen724 commented 2 years ago

When I run pip install ARC-Alkali-Rydberg-Calculator I got the following error:

Defaulting to user installation because normal site-packages is not writeable
Collecting ARC-Alkali-Rydberg-Calculator
  Using cached ARC-Alkali-Rydberg-Calculator-3.2.1.tar.gz (26.5 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy>=0.18.1 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from ARC-Alkali-Rydberg-Calculator) (1.9.1)
Requirement already satisfied: numpy>=1.16.0 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from ARC-Alkali-Rydberg-Calculator) (1.23.2)
Requirement already satisfied: matplotlib>=1.5.3 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from ARC-Alkali-Rydberg-Calculator) (3.5.3)
Requirement already satisfied: sympy>=1.1.1 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from ARC-Alkali-Rydberg-Calculator) (1.11)
Requirement already satisfied: lmfit>=0.9.0 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from ARC-Alkali-Rydberg-Calculator) (1.0.3)
Requirement already satisfied: uncertainties>=3.0.1 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from lmfit>=0.9.0->ARC-Alkali-Rydberg-Calculator) (3.1.7)
Requirement already satisfied: asteval>=0.9.22 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from lmfit>=0.9.0->ARC-Alkali-Rydberg-Calculator) (0.9.27)
Requirement already satisfied: pillow>=6.2.0 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (9.2.0)
Requirement already satisfied: python-dateutil>=2.7 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (2.8.2)
Requirement already satisfied: fonttools>=4.22.0 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (4.37.1)
Requirement already satisfied: packaging>=20.0 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (21.3)
Requirement already satisfied: cycler>=0.10 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (0.11.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (1.4.4)
Requirement already satisfied: pyparsing>=2.2.1 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (3.0.9)
Requirement already satisfied: mpmath>=0.19 in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from sympy>=1.1.1->ARC-Alkali-Rydberg-Calculator) (1.2.1)
Requirement already satisfied: six>=1.5 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from python-dateutil>=2.7->matplotlib>=1.5.3->ARC-Alkali-Rydberg-Calculator) (1.15.0)
Requirement already satisfied: future in /Users/henryhunt/Library/Python/3.8/lib/python/site-packages (from uncertainties>=3.0.1->lmfit>=0.9.0->ARC-Alkali-Rydberg-Calculator) (0.18.2)
Building wheels for collected packages: ARC-Alkali-Rydberg-Calculator
  Building wheel for ARC-Alkali-Rydberg-Calculator (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/setup.py", line 29, in <module>
          setup(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/.eggs/numpy-1.21.0-py3.8-macosx-10.14-arm64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ARC-Alkali-Rydberg-Calculator
  Running setup.py clean for ARC-Alkali-Rydberg-Calculator
  error: subprocess-exited-with-error

  × python setup.py clean did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/setup.py", line 29, in <module>
          setup(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/.eggs/numpy-1.21.0-py3.8-macosx-10.14-arm64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed cleaning build dir for ARC-Alkali-Rydberg-Calculator
Failed to build ARC-Alkali-Rydberg-Calculator
Installing collected packages: ARC-Alkali-Rydberg-Calculator
  Running setup.py install for ARC-Alkali-Rydberg-Calculator ... error
  error: subprocess-exited-with-error

  × Running setup.py install for ARC-Alkali-Rydberg-Calculator did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/setup.py", line 29, in <module>
          setup(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 164, in setup
          _install_setup_requires(attrs)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in _install_setup_requires
          dist.fetch_build_eggs(dist.setup_requires)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 699, in fetch_build_eggs
          resolved_dists = pkg_resources.working_set.resolve(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 779, in resolve
          dist = best[req.key] = env.best_match(
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1064, in best_match
          return self.obtain(req, installer)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1076, in obtain
          return installer(requirement)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 758, in fetch_build_egg
          return fetch_build_egg(self, req)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/installer.py", line 133, in fetch_build_egg
          wheel.install_as_egg(dist_location)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 99, in install_as_egg
          self._install_as_egg(destination_eggdir, zf)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 107, in _install_as_egg
          self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
        File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/wheel.py", line 128, in _convert_metadata
          os.mkdir(destination_eggdir)
      FileExistsError: [Errno 17] File exists: '/private/var/folders/4w/vyhp34ws43v7kxy3v5hv8y740000gn/T/pip-install-ut76oi1x/arc-alkali-rydberg-calculator_fa4383ffdaba42ac8fedb9c600dacc66/.eggs/numpy-1.21.0-py3.8-macosx-10.14-arm64.egg'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> ARC-Alkali-Rydberg-Calculator

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Running the command with sudo -H resulted in the exact same error.

If you read it, you will see it is not a permissions issue. The problem is that wheels.py is trying to create the same numpy egg twice. I briefly looked at your setup.py, but I could not see what was causing the issue. The only thing that raised my suspicion is the option for the setup function: setup_requires=["oldest-supported-numpy"]. This may be an issue with setuptools, however I am not familiar with that package and I would have no idea how to reproduce the error, aside from using your package.

Here are my system details: Operating System: macOS Monterey Version 12.3

Hardware Overview: Model Name: MacBook Pro Model Identifier: MacBookPro18,1 Chip: Apple M1 Pro (<= Note: I am running on Apple Silicon. I don't know if that is related to the problem.) Total Number of Cores: 10 (8 performance and 2 efficiency) Memory: 16 GB System Firmware Version: 7459.101.2 OS Loader Version: 7459.101.2 Serial Number (system): K99XW6P90X Hardware UUID: 5769BFFA-F4D8-553F-82F2-ED2EC8E82255 Provisioning UDID: 00006000-001C40320AA3801E Activation Lock Status: Enabled

nikolasibalic commented 2 years ago

Hi @henhen724 ,

Thank you for your message. GitHub actions doesn't still have Apple M1 runners, so we cannot build wheels and push them to PyPI. Setup instead tries to compile wheels as needed.

Do you have developer tools installed on your Mac command line? xcode-select --install

If you don't have them, please try installing them, and run pip install again. Let me know if that helps.

nikolasibalic commented 2 years ago

Also, can you @henhen724 try installing Anaconda Python distribution, and running Anaconda provided pip for install? Python that comes pre-packaged with OS (that I see you are using) should be kept for OS jobs, and it's usually not optimized heavily for numerical workloads, and it might be missing something we need for wheel builds...

Let me know if that helps.

nikolasibalic commented 2 years ago

Also if anyone finds free builds for CI on Apple ARM, please let me know. I don't find any at the moment, and their integration to CI would enable us to directly ship wheels for Apple ARM architecture (in addition to current Intel's x86 architectures)

henhen724 commented 2 years ago

Good news, anaconda's pip worked for me.

Also, bitrise seems to have a CI for Apple M1: https://www.bitrise.io/why/technologies/virtualized-m1-environment and they have free option that would probably work for this size of library: https://www.bitrise.io/pricing.

Btw, I already had command lines tools installed.