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版本。