张图南 发表于 2020-8-22 09:50:13

pyecharts的安装报错

报错代码
C:\Users\asus>pip install pyecharts
Collecting pyecharts
Downloading https://files.pythonhosted.org/packages/18/f6/e893384d142fdb05c93d101ac26588db0a075033f2e8abf634b8d76d78bd/pyecharts-1.8.1-py3-none-any.whl (134kB)
   |████████████████████████████████| 143kB 3.2kB/s
Collecting simplejson (from pyecharts)
Downloading https://files.pythonhosted.org/packages/49/45/a16db4f0fa383aaf0676fb7e3c660304fe390415c243f41a77c7f917d59b/simplejson-3.17.2.tar.gz (83kB)
   |████████████████████████████████| 92kB 4.0kB/s
Collecting jinja2 (from pyecharts)
Downloading https://files.pythonhosted.org/packages/30/9e/f663a2aa66a09d838042ae1a2c5659828bb9b41ea3a6efa20a20fd92b121/Jinja2-2.11.2-py2.py3-none-any.whl (125kB)
   |████████████████████████████████| 133kB 3.6kB/s
Collecting prettytable (from pyecharts)
Downloading https://files.pythonhosted.org/packages/ef/30/4b0746848746ed5941f052479e7c23d2b56d174b82f4fd34a25e389831f5/prettytable-0.7.2.tar.bz2
Collecting MarkupSafe>=0.23 (from jinja2->pyecharts)
Downloading https://files.pythonhosted.org/packages/4f/8b/da8a2ae5780d38271ac6e691756fc938cf4df8f225eb8aaced0204304932/MarkupSafe-1.1.1-cp38-cp38-win_amd64.whl
Installing collected packages: simplejson, MarkupSafe, jinja2, prettytable, pyecharts
Running setup.py install for simplejson ... done
Running setup.py install for prettytable ... done
Successfully installed MarkupSafe-1.1.1 jinja2-2.11.2 prettytable-0.7.2 pyecharts-1.8.1 simplejson-3.17.2
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:\Users\asus>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/5a/4a/39400ff9b36e719bdf8f31c99fe1fa7842a42fa77432e584f707a5080063/pip-20.2.2-py2.py3-none-any.whl (1.5MB)
   |███████████                     | 522kB 5.3kB/s eta 0:03:05ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 397, in _error_catcher
    yield
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 479, in read
    data = self._fp.read(amt)
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 188, in main
    status = self.run(options, args)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 196, in resolve
    self._resolve_one(requirement_set, req)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\legacy_resolve.py", line 359, 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\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\operations\prepare.py", line 195, in prepare_linked_requirement
    unpack_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 1058, in unpack_url
    unpack_http_url(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 920, in unpack_http_url
    from_path, content_type = _download_http_url(link,
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 1152, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 861, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\utils\hashes.py", line 75, in check_against_chunks
    for chunk in chunks:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 829, in written_chunks
    for chunk in chunks:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\utils\ui.py", line 156, in iter
    for x in it:
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_internal\download.py", line 794, in resp_read
    for chunk in resp.raw.stream(
File "C:\Users\asus\AppData\Local\Programs\Python\Python38\lib\site-packages\pip\_vendor\urllib3\response.py", line 531, 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 496, 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 402, 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 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

百度看了一圈,没有我这报错的解决方法,请问下载pyecharts安装包并解压后如何正确安装?

昨非 发表于 2020-8-22 13:07:10

本帖最后由 昨非 于 2020-8-22 13:12 编辑

我人傻了,更新timeout?

疾风怪盗 发表于 2020-8-22 13:08:38

WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

这句话不是已经提示你了么,升级pip

疾风怪盗 发表于 2020-8-22 13:11:24

pyecharts这玩意好像很坑,旧版本和新版本完全两码事,网上教程都是旧版本的,要注意了,要使用旧版本安装的时候要指定版本

昨非 发表于 2020-8-22 13:13:35

疾风怪盗 发表于 2020-8-22 13:08
WARNING: You are using pip version 19.2.3, however version 20.2.2 is available.
You should consider ...

不对,他执行更新了,但是更新过程timeout超时了

疾风怪盗 发表于 2020-8-22 13:16:08

昨非 发表于 2020-8-22 13:13
不对,他执行更新了,但是更新过程timeout超时了

socket.timeout: The read operation timed out

嗯,发现了,好像是超时了,那就换源呗

昨非 发表于 2020-8-22 13:17:16

本帖最后由 昨非 于 2020-8-22 17:19 编辑

这样,以管理员身份运行cmd
然后:
python -m pip install -U --force-reinstall pip

疾风怪盗 发表于 2020-8-22 13:18:50

python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple

用这个试试吧https://blog.csdn.net/qq_39184753/article/details/107898193
百度一搜就有解决方法

悠悠2264 发表于 2020-8-22 16:55:10

本帖最后由 悠悠2264 于 2020-8-22 16:58 编辑

下载超时,换国内镜像源即可
pip install pyecharts -i https://pypi.tuna.tsinghua.edu.cn/simple/

https://fishc.com.cn/thread-167155-1-1.html
页: [1]
查看完整版本: pyecharts的安装报错