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

Installation of RACK CLI fails on MacBook M1 #399

Open
Robert-Adelard opened this issue May 20, 2021 · 3 comments
Open

Installation of RACK CLI fails on MacBook M1 #399

Robert-Adelard opened this issue May 20, 2021 · 3 comments

Comments

@Robert-Adelard
Copy link

If you try to install the RACK CLI on a MacBook with an M1 (ARM64) processor, bad things happen...

The problem seems to be caused by numpy and the wheel package - here is some relevant output:

Collecting urllib3==1.25.9
  Using cached urllib3-1.25.9-py2.py3-none-any.whl (126 kB)
Collecting zipp==3.1.0
  Using cached zipp-3.1.0-py3-none-any.whl (4.9 kB)
Collecting numpy>=1.11.3
  Using cached numpy-1.20.3.zip (7.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting matplotlib>=2.0.0
  Using cached matplotlib-3.4.2.tar.gz (37.3 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/rjs/Documents/Jobs/clarissa/Work/RACK/cli/venv-arm64/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-install-3yyvf5ow/matplotlib_e7987e4184ea40c89f9a6ae97213682b/setup.py'"'"'; __file__='"'"'/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-install-3yyvf5ow/matplotlib_e7987e4184ea40c89f9a6ae97213682b/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-pip-egg-info-tyxhjhkw
         cwd: /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-install-3yyvf5ow/matplotlib_e7987e4184ea40c89f9a6ae97213682b/
    Complete output (2276 lines):
    WARNING: The wheel package is not available.
      ERROR: Command errored out with exit status 1:
       command: /Users/rjs/Documents/Jobs/clarissa/Work/RACK/cli/venv-arm64/bin/python3.9 /Users/rjs/Documents/Jobs/clarissa/Work/RACK/cli/venv-arm64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/tmpxlmzxkmj
           cwd: /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-wheel-32lpq3qn/numpy_2f6dfe5e76964117807dc2e55904e873

Several screens later, the following error appears:

writing manifest file 'numpy.egg-info/SOURCES.txt'
     Copying numpy.egg-info to build/bdist.macosx-11-arm64/wheel/numpy-1.20.3-py3.9.egg-info
     running install_scripts
     Traceback (most recent call last):
       [...]
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 142, in run_setup
         exec(compile(code, __file__, 'exec'), locals())
       File "setup.py", line 513, in <module>
         setup_package()
       File "setup.py", line 505, in setup_package
         setup(**metadata)
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-wheel-32lpq3qn/numpy_2f6dfe5e76964117807dc2e55904e873/numpy/distutils/core.py", line 169, in setup
         return old_setup(**new_attr)
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 165, in setup
         return distutils.core.setup(**attrs)
       File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/core.py", line 148, in setup
         dist.run_commands()
       File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 966, in run_commands
         self.run_command(cmd)
       File "/opt/homebrew/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/distutils/dist.py", line 985, in run_command
         cmd_obj.run()
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 328, in run
         impl_tag, abi_tag, plat_tag = self.get_tag()
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 252, in get_tag
         plat_name = get_platform(self.bdist_dir)
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 48, in get_platform
         result = calculate_macosx_platform_tag(archive_root, result)
       File "/private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-90moutyt/overlay/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag
         assert len(base_version) == 2
     AssertionError

I may be mistaken, but it looks as though the underlying cause of the failure is a problem with calculate_maxosx_platform_tag, which doesn't allow for the new M1 MacBooks.

@Robert-Adelard
Copy link
Author

This seems to be a known problem that might have been solved already, although the discussion on this GitHub thread is inconclusive:

pypa/wheel#385

@Robert-Adelard
Copy link
Author

I tried installing the latest version of wheel and got a bit further...

(venv-arm64) rjs@Roberts-MacBook-Pro cli % pip install wheel
Collecting wheel
  Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.36.2

(venv-arm64) rjs@Roberts-MacBook-Pro cli % pip install --force -r requirements.txt
Collecting semtk-python3@ git+https://github.com/ge-semtk/semtk-python3@1b61fffa5557bb5c2f124394934a2e6bcef86538
  [....]
Collecting scipy>=0.18.1
  Using cached scipy-1.6.3.tar.gz (27.2 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/rjs/Documents/Jobs/clarissa/Work/RACK/cli/venv-arm64/bin/python3.9 /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-standalone-pip-d7dmw3i3/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-build-env-kmb6oouq/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'wheel<0.37.0' 'setuptools<=51.0.0' 'Cython>=0.29.18,<3.0' 'pybind11>=2.4.3,<2.7.0' 'numpy==1.19.2; python_version=='"'"'3.6'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.2; python_version=='"'"'3.7'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.16.5; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.19.3; python_version=='"'"'3.9'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.19.0; python_version=='"'"'3.6'"'"' and platform_python_implementation=='"'"'PyPy'"'"'' 'numpy==1.20.0; python_version=='"'"'3.7'"'"' and platform_python_implementation=='"'"'PyPy'"'"'' 'numpy; python_version>='"'"'3.10'"'"'' 'numpy; python_version>='"'"'3.8'"'"' and platform_python_implementation=='"'"'PyPy'"'"''
       cwd: None

This time the problem appears to be with building wheel for numpy...

Building wheels for collected packages: numpy
    Building wheel for numpy (PEP 517): started
    Building wheel for numpy (PEP 517): finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/rjs/Documents/Jobs/clarissa/Work/RACK/cli/venv-arm64/bin/python3.9 /var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/tmpil_4lf1c_in_process.py build_wheel /var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/tmpcohu93yv
         cwd: /private/var/folders/pc/9nlfyhzd3hg1chq_dmg_d2dc0000gn/T/pip-install-7of0rkli/numpy_de9f467581cb4d9f82f1f741f756465c

Again, this seems to be a known problem, although so far, I haven't been able to find a workaround:

numpy/numpy#17807

This is all well beyond my knowledge of Python packaging technology, so any suggestions would be helpful.

Thanks.

@glguy
Copy link
Contributor

glguy commented May 26, 2021

This might be a case of needing to update to a more recent package version. I'll try to see what's pulling in numpy and if upgrading can get us to a version new enough to work on M1.

I'm reading that numpy-1.20.1 and up support M1 processors (though obviously you're still seeing it fail)

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

2 participants