看来是时候向 python2 告别了
資深大佬 : ecloud 64
最近要用 astropy 做点东西,2.7 用 pip 装上以后还装了一大堆额外的包,然而还是不好用……
AstroT4:~ zachary$ python test.py 'import sitecustomize' failed; use -v for traceback Traceback (most recent call last): File "test.py", line 4, in <module> from astropy import units as u File "/usr/local/Cellar/[email protected]/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/__init__.py", line 116, in <module> _check_numpy() File "/usr/local/Cellar/[email protected]/2.7.17/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/astropy/__init__.py", line 110, in _check_numpy raise ImportError(msg) ImportError: Numpy version 1.9.0 or later must be installed to use Astropy AstroT4:~ zachary$ pip show numpy 'import sitecustomize' failed; use -v for traceback DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support Name: numpy Version: 1.14.1 Summary: NumPy: array processing for numbers, strings, records, and objects. Home-page: http://www.numpy.org Author: NumPy Developers Author-email: [email protected] License: BSD Location: /usr/local/lib/python2.7/site-packages Requires: Required-by: pyfits, matplotlib, astropy
简直不可理喻(我估计现在向任何人提关于 2.7 的 bug 都不会有反馈的)
然后换 python3,pip 只装了一个 astropy 包,运行起来没有任何问题
大佬有話說 (1)