Python之Pandas库和matplotlib库的安装

Python之Pandas库和matplotlib库的安装,第1张

Python之Pandas库和matplotlib库的安装

Pandas库的安装

*** 作系统环境:window

1.下载对应版本的whl安装包

相关依赖包:(numpy --> six --> python-dateutil --> pytz --> pandas)
numpy:https://pypi.org/project/numpy/#files
six:https://pypi.org/project/six/#files
python-dateutil:https://pypi.org/project/python-dateutil/#files
pytz:https://pypi.org/project/pytz/#files
Pandas:https://pypi.org/project/pandas/#files

2.利用pip命令进行离线安装

1)打开window cmd

2)切换到pip命令所在的目录下

cd C:Users…PythonPython37scripts

3)将下载的whl包复制到该路径下

4)执行以下命令进行安装

pip3 install numpy-1.21.3-cp37-cp37m-win_amd64.whl
pip3 install six-1.16.0-py2.py3-none-any.whl
pip3 install python_dateutil-2.8.2-py2.py3-none-any.whl
pip3 install pytz-2021.3-py2.py3-none-any.whl
pip3 install pandas-1.3.4-cp37-cp37m-win_amd64.whl

matplotlib库的安装

##相关的依赖包:
kiwisolver --> pillow --> numpy --> pyparsing --> python-dateutil --> cycler --> six --> matplotlib

##下载
pyparsing:https://pypi.org/project/pyparsing/#files
cycler:https://pypi.org/project/Cycler/#files
kiwisolver:https://pypi.org/project/kiwisolver/#files
pillow:https://pypi.org/project/Pillow/#files

##安装
pip3 install cycler-0.10.0-py2.py3-none-any.whl
pip3 install pyparsing-3.0.3-py3-none-any.whl
pip3 install kiwisolver-1.3.2-cp37-cp37m-win_amd64.whl
pip3 install Pillow-8.4.0-cp37-cp37m-win_amd64.whl
pip3 install matplotlib-3.4.3-cp37-cp37m-win_amd64.whl

问题1:出现不是内部或外部命令
‘pip’ 不是内部或外部命令,也不是可运行的程序或批处理文件。
解决办法:
方法1:设置环境变量
方法2:利用盘符和cd的命令切换到对应的路径下执行

问题2:pandas-0.16.2-cp26-none-win_amd64.whl is not a supported wheel on this platform.
原因:版本不对应,cp26表示是2.6版本的
解决办法:重新下载对应版本cp37版本pandas库

问题3:依赖包安装问题,需要安装numpy库
Collecting numpy>=1.17.3; platform_machine != “aarch64” and platform_machine != “arm64” and python_version < “3.10” (from pandas==1.3.4)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError…

Collecting python-dateutil>=2.7.3 (from pandas==1.3.4)
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError…

Collecting six>=1.5 (from python-dateutil==2.8.2) …

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/4827322.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-11-10
下一篇 2022-11-10

发表评论

登录后才能评论

评论列表(0条)

保存