Last login: Thu Mar 12 20:33:48 on console
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
MBP:~ Bill$ pip3 install pandas
Requirement already satisfied: pandas in /usr/local/lib/python3.7/site-packages (0.23.4)
Requirement already satisfied: pytz>=2011k in /usr/local/lib/python3.7/site-packages (from pandas) (2018.7)
Requirement already satisfied: python-dateutil>=2.5.0 in /usr/local/lib/python3.7/site-packages (from pandas) (2.7.5)
Requirement already satisfied: numpy>=1.9.0 in /usr/local/lib/python3.7/site-packages (from pandas) (1.15.4)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/site-packages (from python-dateutil>=2.5.0->pandas) (1.11.0)
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
pip3 install pandas安装python的第三方库pandas,提示当前pip等级是19.3.1,最新的版本是20.0.2。需要使用pip install --upgrade pip命令进行升级。
MBP:~ Bill$ pip install --upgrade pip
Traceback (most recent call last):
File "/usr/local/opt/python/libexec/bin/pip", line 11, in <module>
sys.exit(main())
TypeError: 'module' object is not callable
命令出错,重新换个写法
python -m pip install -U pip
MBP:~ Bill$ python -m pip install -U pip
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1034: The handshake operation timed out'))': /simple/pip/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', timeout('_ssl.c:1034: The handshake operation timed out'))': /simple/pip/
Collecting pip
Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
|████████████████████████████████| 1.4MB 20kB/s
Installing collected packages: pip
Found existing installation: pip 19.3.1
Uninstalling pip-19.3.1:
Successfully uninstalled pip-19.3.1
Successfully installed pip-20.0.2
安装成功,输入pip --version查看一下版本。
MBP:~ Bill$ pip --version
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.0.2 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
再用pip3 install pandas就正常了