Unable to install NumPy from pip on python3.

Asked 2 years ago, Updated 2 years ago, 15 views

There was python 2.7 locally, but I installed python 3 using homebrew because I wanted to use python 3.
 And I tried to install NumPy

$pip3 install numpy

The following error occurred when I ran with :

.
.

  File "numpy/core/setup.py", line 293, check_types
    "Cannot compile 'Python.h'.Perhaps you need to"\
SystemError: Cannot compile 'Python.h'.Perhaps you need to install python-dev | python-develop.

----------------------------------------
Command "/usr/local/opt/python3/bin/python3.5 -c "import setuptools, tokenize;__file__='/private/var/folders/3s/sq3306n57rgf5539s6bw67qm0000gn/T/pip-build-b_r_jvk6/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3s/sq3306n57rgf5539s6bw67qm0000gn/T/pip-vjiol_uu-record/install-record.txt --single-version-external-managed --compile "failed with error code 1 in/private/var/folder/3s/sq3306n57rgf5539s6bw67qm0000gn/T/pipe-build-b_r_jvk6/numpy

I was wondering if I should install python-dev, but I didn't know how to install it.

The environment is mac, python 3.5.Thank you for your cooperation.

python

2022-09-29 22:32

1 Answers

Refer to the link in the comments

brew install homebrew/python/numpy -- with-python3

was successfully installed in .Thank you.


2022-09-29 22:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.