windos10 Python 安裝pandas包

windows10 下安裝pandas

1  cmd

2  pip install pandas

for x in it:
  File "c:\python3.5\lib\site-packages\pip\download.py", line 586, in resp_read
    decode_content=False):
  File "c:\python3.5\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 307, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\python3.5\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 258, in read
    raise ReadTimeoutError(self._pool, None, 'Read timed out.')
pip._vendor.requests.packages.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.

以上是由於連接超時出現的錯誤

2.1  處理方法:換源
  在windows  C:\Users\系統登錄賬號名稱\AppData\Roaming路徑下 新建pip文件夾

  我的賬戶路徑是C:\Users\Administrator\AppData\Roaming  根據個人電腦選擇紅色部分
  進入新建的這個pip文件夾內,新建文件pip.ini,以記事本形式打開,然後編寫
  [global]
  timeout = 6000
  index-url = http://mirrors.aliyun.com/pypi/simple/
  trusted-host = mirrors.aliyun.com

3 通過以上修改後再次執行

pip install pandas

4 速度很快但是出現新問題

       Command "python setup.py egg_info" failed with error code 1 in C:\Users\ADMINI~1\AppData\Local\Temp\pip-build-49f653mq\pandas
  You are using pip version 7.1.2, however version 19.3.1 is available.
  You should consider upgrading via the 'python -m pip install --upgrade pip' command.

4.1  提示的很明白了 升級pip。

4.2 執行python -m pip install --upgrade pip

4.3 pip install Cython

4.4 pip install numpy

4.5 pip install pandas

ERROR: Package 'pandas' requires a different Python: 3.5.0 not in '>=3.5.3'

 又雙叒叕  出錯啦啦啦啦 ~~~  提示的很清楚,安裝的的pandas與現在本機的python3.5版本不匹配需要升級到3.5.3及以上。

這個問題兩種選擇:

  1 升級python版本。

  2  需要安裝與python版本匹配的包。

選擇第二種方法:安裝與python版本匹配的包

 問題處理:

  使用  pip install pandas 默認下載的是pandas-0.25.3-cp35-cp35m-win_amd64.whl 但是這個包支持python3.5.3以上版本我的是3.5版本,不支持。所以需要使用pandas-0.25版本一下的,所以使用命令 pip install "pandas<0.25"  pip會自動安裝相關的包dateutil等

 

總結:1 安裝pandas前需要按順序安裝好他所依賴的其他的包

           2 選擇好對應的python版本。

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章