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://*.com/questions/63656891/importerror-plotly-express-requires-pandas-to-be-installed

上一篇:NAO机器人opencv版本问题解决


下一篇:微信js接口自定义分享内容