如何安装matplotlib
看了书上和网上的方法,都装不上。特此求助有经验的网友如何在当前python版本中安装matplotlib我在cmd查看到python版本:
Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) on win32
Type "help", "copyright", "credits" or "license" for more information.
我下了文件matplotlib-3.3.2-cp38-cp38-win32.whl。然后按书上的方法没法装上
报错代码如下:
ERROR: matplotlib-3.3.2-cp38-cp38-win32.whl is not a supported wheel on this platform.
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\asus\AppData\Local\Programs\Python\Python38\python.exe -m pip install --upgrade pip' command. cmd命令行
cd切到这个目录
C:\Users\asus\AppData\Local\Programs\Python\Python38\
输入python.exe -m pip install --upgrade pip更新pip先 昨非 发表于 2020-10-16 23:13
cmd命令行
cd切到这个目录
更新pip也报错了,哭了
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_catcher
yield
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
status = self.run(options, args)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
return func(self, options, args)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
requirement_set = resolver.resolve(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 255, in unpack_url
file = get_http_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in _download_http_url
for chunk in download.chunks:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
for x in it:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\network\utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\asus\AppData\Local\Programs\Python\Python38\python.exe -m pip install - 张图南 发表于 2020-10-16 23:18
更新pip也报错了,哭了
ERROR: Exception:
Traceback (most recent call last):
看你报错的最后一行,把它的提示复制全,然后在当前目录下执行
python.exe -m pip install -(后面补全) 昨非 发表于 2020-10-16 23:23
看你报错的最后一行,把它的提示复制全,然后在当前目录下执行
补全了也报错。我太难了 张图南 发表于 2020-10-16 23:29
补全了也报错。我太难了
复制报错过来 昨非 发表于 2020-10-16 23:33
复制报错过来
C:\Users\asus\AppData\Local\Programs\Python\Python38>python.exe -m pip install --upgrade pip
Collecting pip
Downloading pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
|██ | 102 kB 2.9 kB/s eta 0:08:03ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 437, in _error_catcher
yield
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 519, in read
data = self._fp.read(amt) if not fp_closed else b""
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
status = self.run(options, args)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
return func(self, options, args)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\commands\install.py", line 324, in run
requirement_set = resolver.resolve(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 183, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 388, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\resolution\legacy\resolver.py", line 340, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 467, in prepare_linked_requirement
local_file = unpack_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 255, in unpack_url
file = get_http_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 129, in get_http_url
from_path, content_type = _download_http_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in _download_http_url
for chunk in download.chunks:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\cli\progress_bars.py", line 168, in iter
for x in it:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\network\utils.py", line 64, in response_chunks
for chunk in response.raw.stream(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 576, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 541, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\asus\AppData\Local\Programs\Python\Python38\python.exe -m pip install --upgrade pip' command. 张图南 发表于 2020-10-16 23:34
C:%users\asus\AppData\Local\Programs\Python\Python38>python.exe -m pip install --upgrade pip
Coll ...
超时了,可能需要换源{:10_284:} 昨非 发表于 2020-10-16 23:38
超时了,可能需要换源
怎么换源啊?
看看这个有没有用
Python cmd用法大全 pip install和镜像
https://fishc.com.cn/thread-180234-1-1.html
(出处: 鱼C论坛)
这问题我没亲身遇到过,你来看看?@疾风怪盗 pip 安装第三方库速度太慢
可设置 pip 从国内的镜像源下载安装
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
设置方法,以清华镜像源为例:
临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xxxxxxx
永久设置
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
有网的情况下,除了某些原因外,还是pip更方便,内网的话只能下载后安装
看着报错,就是先升级pip到20.2.3,然后再安装matplotlib
昨非 发表于 2020-10-16 23:43
这问题我没亲身遇到过,你来看看?@疾风怪盗
{:10_312:}我也没遇到过。。。。。之前有遇到pip需要更新的提示,然后更新了就好了。。。。。没遇到matplotlib不能安装的问题。。。。。。。 疾风怪盗 发表于 2020-10-17 00:17
我也没遇到过。。。。。之前有遇到pip需要更新的提示,然后更新了就好了。。。。。没遇到matpl ...
超时换源啥的,我是听说过,没办法啦{:10_245:} 昨非 发表于 2020-10-17 00:20
超时换源啥的,我是听说过,没办法啦
换源就使用清华镜像源啊,就是加个-i的参数,其实是一样的 疾风怪盗 发表于 2020-10-17 00:37
换源就使用清华镜像源啊,就是加个-i的参数,其实是一样的
哦,受教了 疾风怪盗 发表于 2020-10-17 00:16
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
有网的情况下,除了某些原因 ...
我升级了pip,但是按照书上的方法行不通啊。大佬能教教我怎么安装matplotlib吗
张图南 发表于 2020-10-17 19:05
我升级了pip,但是按照书上的方法行不通啊。大佬能教教我怎么安装matplotlib吗
什么叫书上的方法?你的pip现在版本是多少?
然后用pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib,报错是什么? 张图南 发表于 2020-10-17 19:05
我升级了pip,但是按照书上的方法行不通啊。大佬能教教我怎么安装matplotlib吗
感谢大佬。我已经成功换源更新了pip。再次尝试了一下安装matplotlib就按照上了
C:\Users\asus\AppData\Local\Programs\Python\Python38>pip install matplotlib
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: numpy, six, python-dateutil, pyparsing, pillow, kiwisolver, cycler, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.2.0 matplotlib-3.3.2 numpy-1.19.2 pillow-8.0.0 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0
再次向您表达诚挚的谢意
页:
[1]
2