Python教程

python项目ImportError: Plotly express requires pandas to be installed.解决方案

本文主要是介绍python项目ImportError: Plotly express requires pandas to be installed.解决方案,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

文章目录

      • 遇到的问题
      • 解决方法
      • 参考

遇到的问题

解决方法

运行

pip install pandas

之后遇到问题如下:

PS D:\user\文档\python\python_work\data_visualization> pip install pandas
Defaulting to user installation because normal site-packages is not writeable
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))': /simple/pandas/
Could not fetch URL https://pypi.org/simple/pandas/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pandas/ (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1125)'))) - skipping
ERROR: Could not find a version that satisfies the requirement pandas
ERROR: No matching distribution found for pandas

然后运行

pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com

得以解决,显示Successfully installed pandas-1.2.4 pytz-2021.1,即成功安装。

PS D:\user\文档\python\python_work\data_visualization>  pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
>>
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: http://pypi.douban.com/simple
Collecting pandas
  Downloading http://pypi.doubanio.com/packages/b9/b9/6a13093ca4e4ea11af84fd40076601397f725944add620937f27319a940b/pandas-1.2.4-cp38-cp38-win_amd64.whl (9.3 MB)
     |████████████████████████████████| 9.3 MB 2.2 MB/s
Collecting pytz>=2017.3
  Downloading http://pypi.doubanio.com/packages/70/94/784178ca5dd892a98f113cdd923372024dc04b8d40abe77ca76b5fb90ca6/pytz-2021.1-py2.py3-none-any.whl (510 kB)
     |████████████████████████████████| 510 kB 3.3 MB/s
Requirement already satisfied: numpy>=1.16.5 in c:\users\m1521\appdata\roaming\python\python38\site-packages (from pandas) (1.20.1+mkl)
Requirement already satisfied: python-dateutil>=2.7.3 in c:\users\m1521\appdata\roaming\python\python38\site-packages (from pandas) (2.8.1)
Requirement already satisfied: six>=1.5 in c:\users\m1521\appdata\roaming\python\python38\site-packages (from python-dateutil>=2.7.3->pandas) (1.15.0)
Installing collected packages: pytz, pandas
Successfully installed pandas-1.2.4 pytz-2021.1

参考

[1]https://stackoverflow.com/questions/63656891/importerror-plotly-express-requires-pandas-to-be-installed

这篇关于python项目ImportError: Plotly express requires pandas to be installed.解决方案的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!