宇宙最强pyqt5的安装(一)!!!

2023-05-16

- 前期准备工作:

pythonIDE3.5以上版本
开发环境pycharm
编程知识熟悉python基本语法

在线安装pyqt5

####安装sip

C:\Users\xxx>pip install sip
Collecting sip
  Downloading https://files.pythonhosted.org/packages/89/34/056db01926839dd05f80a08a579ee2f4f6625913b0620580ee580fa05fbf/sip-4.19.8-cp37-none-win32.whl (42kB)
     |████████████████████████████████| 51kB 93kB/s
Installing collected packages: sip
Successfully installed sip-4.19.8

###安装pyqt5(产生报错信息)

C:\Users\xxx>pip install pyqt5
Collecting pyqt5
  Downloading https://files.pythonhosted.org/packages/c9/e3/302602473ad0997d9a86b69324350bcfd13ac137ffa76806d6f58bda1e1d/PyQt5-5.13.0-5.13.0-cp35.cp36.cp37.cp38-none-win32.whl (41.9MB)
     |                                | 30kB 19kB/s eta 0:36:16ERROR: Exception:
Traceback (most recent call last):
  File "d:\python3\install\lib\site-packages\pip\_vendor\urllib3\response.py", line 360, in _error_catcher
    yield
  File "d:\python3\install\lib\site-packages\pip\_vendor\urllib3\response.py", line 442, in read
    data = self._fp.read(amt)
  File "d:\python3\install\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
    data = self.__fp.read(amt)
  File "d:\python3\install\lib\http\client.py", line 447, in read
    n = self.readinto(b)
  File "d:\python3\install\lib\http\client.py", line 491, in readinto
    n = self.fp.readinto(b)
  File "d:\python3\install\lib\socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "d:\python3\install\lib\ssl.py", line 1052, in recv_into
    return self.read(nbytes, buffer)
  File "d:\python3\install\lib\ssl.py", line 911, 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 "d:\python3\install\lib\site-packages\pip\_internal\cli\base_command.py", line 178, in main
    status = self.run(options, args)
  File "d:\python3\install\lib\site-packages\pip\_internal\commands\install.py", line 352, in run
    resolver.resolve(requirement_set)
  File "d:\python3\install\lib\site-packages\pip\_internal\resolve.py", line 131, in resolve
    self._resolve_one(requirement_set, req)
  File "d:\python3\install\lib\site-packages\pip\_internal\resolve.py", line 294, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "d:\python3\install\lib\site-packages\pip\_internal\resolve.py", line 242, in _get_abstract_dist_for
    self.require_hashes
  File "d:\python3\install\lib\site-packages\pip\_internal\operations\prepare.py", line 347, in prepare_linked_requirement
    progress_bar=self.progress_bar
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 886, in unpack_url
    progress_bar=progress_bar
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 746, in unpack_http_url
    progress_bar)
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 954, in _download_http_url
    _download_url(resp, link, content_file, hashes, progress_bar)
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 683, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "d:\python3\install\lib\site-packages\pip\_internal\utils\hashes.py", line 62, in check_against_chunks
    for chunk in chunks:
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 651, in written_chunks
    for chunk in chunks:
  File "d:\python3\install\lib\site-packages\pip\_internal\utils\ui.py", line 156, in iter
    for x in it:
  File "d:\python3\install\lib\site-packages\pip\_internal\download.py", line 640, in resp_read
    decode_content=False):
  File "d:\python3\install\lib\site-packages\pip\_vendor\urllib3\response.py", line 494, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "d:\python3\install\lib\site-packages\pip\_vendor\urllib3\response.py", line 459, in read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
  File "d:\python3\install\lib\contextlib.py", line 130, in __exit__
    self.gen.throw(type, value, traceback)
  File "d:\python3\install\lib\site-packages\pip\_vendor\urllib3\response.py", line 365, 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.

更改如下命令解决此报错信息

C:\Users\xxx>pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org  --upgrade  PyQt5
Collecting PyQt5
  Downloading https://files.pythonhosted.org/packages/c9/e3/302602473ad0997d9a86b69324350bcfd13ac137ffa76806d6f58bda1e1d/PyQt5-5.13.0-5.13.0-cp35.cp36.cp37.cp38-none-win32.whl (41.9MB)
     |████████████████████████████████| 42.0MB 467kB/s
Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5)
  Downloading https://files.pythonhosted.org/packages/38/10/4ee0be6337eddcdf9070659b314416c66b73198505d61995684ff5538e69/PyQt5_sip-4.19.18-cp37-none-win32.whl (44kB)
     |████████████████████████████████| 51kB 1.6MB/s
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.13.0 PyQt5-sip-4.19.18

###安装pyqt5-tool

C:\Users\xxx>pip install PyQt5-tools
Collecting PyQt5-tools
  Downloading https://files.pythonhosted.org/packages/21/ff/7578d6d124926ff6cd1ef13c8c095063ad4c3811f4506788a915607aee81/pyqt5_tools-5.11.3.1.4-cp37-none-win32.whl (47.9MB)
     |████████████████████████████████| 47.9MB 182kB/s
Collecting pyqt5==5.11.3 (from PyQt5-tools)
  Downloading https://files.pythonhosted.org/packages/26/78/c215008e70982944272b6c329a76cc11259e7378a3e23418fbe0bd48de96/PyQt5-5.11.3-5.11.2-cp35.cp36.cp37.cp38-none-win32.whl (39.4MB)
     |████████████████████████████████| 39.4MB 121kB/s
Collecting click (from PyQt5-tools)
  Downloading https://files.pythonhosted.org/packages/fa/37/45185cb5abbc30d7257104c434fe0b07e5a195a6847506c074527aa599ec/Click-7.0-py2.py3-none-any.whl (81kB)
     |████████████████████████████████| 81kB 58kB/s
Collecting python-dotenv (from PyQt5-tools)
  Downloading https://files.pythonhosted.org/packages/57/c8/5b14d5cffe7bb06bedf9d66c4562bf90330d3d35e7f0266928c370d9dd6d/python_dotenv-0.10.3-py2.py3-none-any.whl
Requirement already satisfied: PyQt5_sip<4.20,>=4.19.11 in d:\python3\install\lib\site-packages (from pyqt5==5.11.3->PyQt5-tools) (4.19.18)
Installing collected packages: pyqt5, click, python-dotenv, PyQt5-tools
  Found existing installation: PyQt5 5.13.0
    Uninstalling PyQt5-5.13.0:
      Successfully uninstalled PyQt5-5.13.0
Successfully installed PyQt5-tools-5.11.3.1.4 click-7.0 pyqt5-5.11.3 python-dotenv-0.10.3

###检查安装
在这里插入图片描述

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

宇宙最强pyqt5的安装(一)!!! 的相关文章

随机推荐