我是Mac用户,正在尝试在Python 3.6.6中安装Pandas。在IDLE / VS Code中使用以完成工作。
Hasans-MacBook-Pro:~ hasan-macbookpro$ python3 --version
Python 3.6.6
Hasans-MacBook-Pro:~ hasan-macbookpro$
但是当我运行pip install pandas
时,它将在Python 2.7中下载,如下所示。当我进入IDLE时,因为Pandas不在3.6.6中。它给我错误。
有人可以指导如何做吗?
Hasans-MacBook-Pro:~ hasan-macbookpro$ pip install pandas
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
Requirement already satisfied: pandas in ./Library/Python/2.7/lib/python/site-packages (0.24.2)
Requirement already satisfied: python-dateutil>=2.5.0 in ./Library/Python/2.7/lib/python/site-packages (from pandas) (2.8.1)
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas) (2013.7)
Requirement already satisfied: numpy>=1.12.0 in ./Library/Python/2.7/lib/python/site-packages (from pandas) (1.16.5)
Requirement already satisfied: six>=1.5 in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from python-dateutil>=2.5.0->pandas) (1.12.0)
Hasans-MacBook-Pro:~ hasan-macbookpro$
答案 0 :(得分:0)
尝试pip3 install pandas
为python3指定它。