【发布时间】:2021-11-29 19:58:18
【问题描述】:
以下命令显示我的机器中有两个 numpy。
bash-4.2$ conda list numpy
# packages in environment at /app/anaconda3:
#
# Name Version Build Channel
numpy 1.15.0 py36h1b885b7_0 https://mycompany.intranet/repository/anaconda-main-proxy
numpy-base 1.15.0 py36h3dfced4_0 https://mycompany.intranet/repository/anaconda-main-proxy
bash-4.2$ pip list | grep numpy
numpy (1.19.5)
numpydoc (1.1.0)
导入pandas时出现如下错误。
>>> import pandas
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/app/anaconda3/lib/python3.6/site-packages/pandas/__init__.py", line 22, in <module>
from pandas.compat.numpy import (
File "/app/anaconda3/lib/python3.6/site-packages/pandas/compat/numpy/__init__.py", line 21, in <module>
"this version of pandas is incompatible with numpy < 1.15.4\n"
ImportError: this version of pandas is incompatible with numpy < 1.15.4
your numpy version is 1.15.0.
Please upgrade numpy to >= 1.15.4 to use this pandas version
有没有办法让import pandas使用numpy的pip版本,哪个版本是1.19.5? conda频道是公司内部频道,版本较旧。
【问题讨论】:
-
你必须使用你系统的python而不是
conda版本。 -
系统的python是v2.7,我必须使用conda版本是V3.6