我正在try 在python3.9.6和MacOS Sonoma 14.3.1下安装pyregion(一个与天文数据分析有关的包).
我try 过各种方法,但总是遇到新的障碍. 在标准方法之后: pip3 install pyregion 它失败并出现错误消息 "Failed building wheel for pyregion". 在try 了在stackoverflow上找到的许多其他建议之后,包括升级numpy,升级pip3本身, python3 -m pip install pyregion
我现在try 直接安装这些文件,这些文件可以在以下位置找到: https://pypi.org/project/pyregion/#files个
run 的第一个障碍
python3 setup.py install
个
是:
Traceback (most recent call last):
File "/Users/claudiopedrazzi/Downloads/pyregion-2.2.0/setup.py", line 5, in <module>
from Cython.Build import cythonize
ModuleNotFoundError: No module named 'Cython'*
然后我还安装了Cython
pip3 install --upgrade cython
它成功地为我安装了cython—3.0.9. 再次try 运行www.example.com,我得到一个很长的错误消息,结尾是:
/Users/claudiopedrazzi/Library/Python/3.9/lib/python/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
pyregion/_region_filter.c:18264:3: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
import_array();
^~~~~~~~~~~~~~
/Users/claudiopedrazzi/Library/Python/3.9/lib/python/site-packages/numpy/core/include/numpy/__multiarray_api.h:1558:151: note: expanded from macro 'import_array'
#define import_array() {if (_import_array() < 0) {PyErr_Print(); PyErr_SetString(PyExc_ImportError, "numpy.core.multiarray failed to import"); return NULL; } }
^~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/stddef.h:89:16: note: expanded from macro 'NULL'
# define NULL ((void*)0)
^~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
我真的需要一步一步的指导.我的环境是最新的,我不明白为什么这个特殊的包会出现这些问题,而其他的包,如astropy和matplotlib工作得很好.