Unable to install any library with pip install on macbook pro M1 chip

Viewed 922

I installed tensorflow on my new macbook pro M1 chip in a miniforge3 environment following this tutorial (https://github.com/apple/tensorflow_macos/issues/153). Tensorflow seems to work fine. However I now have troubles when trying to install libraries such as pandas or scikit-learn with pip.

(tf_env) romainbesombes@iphonedejeanne ~ % python --version
Python 3.8.8
(tf_env) romainbesombes@iphonedejeanne ~ % which python
/Users/romainbesombes/miniforge3/envs/tf_env/bin/python

When I try pip install pandas, I have the following error:

(tf_env) romainbesombes@iphonedejeanne ~ % pip install scikit-learn
Collecting scikit-learn
  Using cached scikit-learn-0.24.1.tar.gz (7.4 MB)
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:

   command: /Users/romainbesombes/miniforge3/envs/tf_env/bin/python3.8
 /Users/romainbesombes/miniforge3/envs/tf_env/lib/python3.8/site-packages/pip install --ignore-
installed --no-user --prefix /private/var/folders/ws/rnp7yn295s13fdr961g5szxw0000gn/T/pip-build-
env-ambjl5m8/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i 
https://pypi.org/simple -- setuptools wheel 'Cython>=0.28.5' 'numpy==1.13.3; 
python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and 
platform_system!='"'"'AIX'"'"' and platform_python_implementation=='"'"'CPython'"'"'' 
'numpy==1.14.0; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and 
platform_system!='"'"'AIX'"'"' and platform_python_implementation!='"'"'CPython'"'"'' 
'numpy==1.16.0; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and 
platform_system=='"'"'AIX'"'"'' 'numpy==1.16.0; python_version=='"'"'3.7'"'"' and 
platform_machine!='"'"'aarch64'"'"' and platform_system=='"'"'AIX'"'"'' 'numpy==1.19.0; 
python_version=='"'"'3.6'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.0; 
python_version=='"'"'3.7'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.0; 
python_version=='"'"'3.8'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.14.5; 
python_version=='"'"'3.7'"'"' and platform_machine!='"'"'aarch64'"'"' and 
platform_system!='"'"'AIX'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and 
platform_machine!='"'"'aarch64'"'"'' 'numpy==1.19.3; python_version=='"'"'3.9'"'"'' 
'scipy>=0.19.1'
       cwd: None
  Complete output (3663 lines):
[...]

I had the same issue when trying to install pandas and it worked when I used conda install pandas instead of pip install pandas. however, I would like to use pip in the future... any idea how to solve this? Thanks in advance

0 Answers
Related