pandas: Can't install Pandas on Mac M1
Environment Mac M1 Python 3.8.2 created using Xcode Command Line Tools for M1 Macs
On trying to install pandas, it failed and it returns very long erorr message starts as below
(py382tf) mgd@MGD ~ % pip install pandas Collecting pandas Using cached https://files.pythonhosted.org/packages/8a/6f/7fcef020b5b305862cacf376183eaa0f907f2fa42f0b687b2a9a2c6cda4d/pandas-1.2.3.tar.gz Installing build dependencies … error ERROR: Command errored out with exit status 1: command: /Users/mgd/py382tf/bin/python3 /Users/mgd/py382tf/lib/python3.8/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-build-env-orb4vxpv/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple – setuptools wheel ‘Cython>=0.29.21,❤️’ ‘numpy==1.16.5; python_version==’“'”‘3.7’“'”’ and platform_system!=‘"’“‘AIX’”‘"’’ ‘numpy==1.17.3; python_version==’“'”‘3.8’“'”’ and platform_system!=‘"’“‘AIX’”‘"’’ ‘numpy==1.16.5; python_version==’“'”‘3.7’“'”’ and platform_system==‘"’“‘AIX’”‘"’’ ‘numpy==1.17.3; python_version==’“'”‘3.8’“'”’ and platform_system==‘"’“‘AIX’”‘"’’ ‘numpy; python_version>=’“'”‘3.9’“'”‘’ cwd: None Complete output (4451 lines): Ignoring numpy: markers ‘python_version == “3.7” and platform_system != “AIX”’ don’t match your environment Ignoring numpy: markers ‘python_version == “3.7” and platform_system == “AIX”’ don’t match your environment Ignoring numpy: markers ‘python_version == “3.8” and platform_system == “AIX”’ don’t match your environment Ignoring numpy: markers ‘python_version >= “3.9”’ don’t match your environment Collecting setuptools Using cached https://files.pythonhosted.org/packages/9e/d4/b99a960314121a003e9f39c61dfde01a1010bb47661e193a7722f7f32d52/setuptools-54.2.0-py3-none-any.whl Collecting wheel Using cached https://files.pythonhosted.org/packages/65/63/39d04c74222770ed1589c0eaba06c05891801219272420b40311cd60c880/wheel-0.36.2-py2.py3-none-any.whl Collecting Cython<3,>=0.29.21 Using cached https://files.pythonhosted.org/packages/9e/98/bff39b3acaebbc6102be71797f655bbe60738f7339db4ad7bd0772c08daf/Cython-0.29.22-py2.py3-none-any.whl Collecting numpy==1.17.3 Using cached https://files.pythonhosted.org/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip Installing collected packages: setuptools, wheel, Cython, numpy Running setup.py install for numpy: started Running setup.py install for numpy: finished with status ‘error’ ERROR: Command errored out with exit status 1: command: /Users/mgd/py382tf/bin/python3 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-install-x_x_2bsb/numpy/setup.py’“'”‘; file=’“'”‘/private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-install-x_x_2bsb/numpy/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ install --record /private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-record-73r6zlw4/install-record.txt --single-version-externally-managed --prefix /private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-build-env-orb4vxpv/overlay --compile --install-headers /Users/mgd/py382tf/include/site/python3.8/numpy cwd: /private/var/folders/px/zqhcsbbx4yxfmhc7927tnfj00000gn/T/pip-install-x_x_2bsb/numpy/ Complete output (4428 lines): Running from numpy source directory.
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install numpy` (last NumPy release on PyPi)
blas_opt_info:
blas_mkl_info:
customize UnixCCompiler
libraries mkl_rt not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
blis_info:
customize UnixCCompiler
libraries blis not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
openblas_info:
customize UnixCCompiler
customize UnixCCompiler
libraries openblas not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries tatlas not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
atlas_3_10_blas_info:
customize UnixCCompiler
libraries satlas not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
customize UnixCCompiler
libraries ptf77blas,ptcblas,atlas not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
atlas_blas_info:
customize UnixCCompiler
libraries f77blas,cblas,atlas not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
NOT AVAILABLE
accelerate_info:
customize UnixCCompiler
libraries accelerate not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
Library accelerate was not found. Ignoring
customize UnixCCompiler
libraries veclib not found in ['/Users/mgd/py382tf/lib', '/usr/lib']
Library veclib was not found. Ignoring
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 34 (14 by maintainers)
Hello,
I faced the same problem, and solved it by doing the following steps:
This should fix the issue.
I installed pandas in my M1 Macbook Pro today.
pip3 install pandas
It took a while but not more than 3 minutes though. It got successfully installed.
Here’s my log
Steps I took in a brand new M1 Macbook Air to make it work:
clearly the solution is for Apple to send me an M1 MBP so i can ensure we have testing on the platform.
pip install numpy
only works fornumpy>=1.20
on M1. I think when you runpip install pandas
, pip is trying to install a numpy of version < 1.20.You could try to build pandas from source like this.
@jbrockmendel We probably should set a min numpy version in
pyproject.toml
for M1.my error for example comes from Docker. Even if I do all of this I’m not going to install it inside the image, which is where I’m getting the error from
My solutions are as shown below.
Discaimer: YMMV
I installed python3.8.10 with macOS 64-bit universal2 installer from python.org and faced the same issue when I run
pip install pandas==1.0.5
. For me one of the followings worked.Method 1
pip install pandas==1.0.5
and no error appeared.Method 2
pip install pandas==1.0.5
and no error appeared.Sounds like this issues is relatively resolved in 1.3 at least so closing. Happy to reopen if that didn’t fix things.
We don’t currently have wheels for arm64(M1) so pip will try to build pandas from source. I think a fix was merged in 1.3 that should allow everyone to install/build pandas from a clean environment. In a future release, we’ll try to get arm64/universal2 wheels out.
I’m having the same problem as @mkismy. Trying to install Pandas 1.3.4 via Poetry, running Python 3.9.8