当前位置: 首页> 汽车> 新车 > python3.8环境下安装pyqt5

python3.8环境下安装pyqt5

时间:2025/7/12 5:07:29来源:https://blog.csdn.net/qq_37269626/article/details/139399050 浏览次数: 0次

1.实验目的

测试python可视化工具包pyqt5,为后期做系统前端页面做铺垫

2.实验环境

1.软件
anaconda2.5 + pycharm2024.1.1 + pyqt5
2.硬件
GPU 4070TI + Intel I7 1400K

3. 安装步骤


(base) C:\Users\PC>conda -V
conda 23.7.4(base) C:\Users\PC>conda create qttest python3.8
usage: conda-script.py create [-h] [--clone ENV] (-n ENVIRONMENT | -p PATH) [-c CHANNEL] [--use-local][--override-channels] [--repodata-fn REPODATA_FNS] [--experimental {jlap,lock}][--strict-channel-priority] [--no-channel-priority] [--no-deps | --only-deps] [--no-pin][--copy] [--no-shortcuts] [-C] [-k] [--offline] [--json] [-v] [-q] [-d] [-y][--download-only] [--show-channel-urls] [--file FILE] [--no-default-packages][--solver {classic,libmamba} | --experimental-solver {classic,libmamba}] [--dev][package_spec ...]
conda-script.py create: error: one of the arguments -n/--name -p/--prefix is required(base) C:\Users\PC>conda create -n qttest python3.8
Retrieving notices: ...working... done
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.Collecting package metadata (repodata.json): done
Solving environment: failedPackagesNotFoundError: The following packages are not available from current channels:- python3.8Current channels:- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/win-64- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/win-64- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch- https://repo.anaconda.com/pkgs/main/win-64- https://repo.anaconda.com/pkgs/main/noarch- https://repo.anaconda.com/pkgs/r/win-64- https://repo.anaconda.com/pkgs/r/noarch- https://repo.anaconda.com/pkgs/msys2/win-64- https://repo.anaconda.com/pkgs/msys2/noarchTo search for alternate channels that may provide the conda package you're
looking for, navigate tohttps://anaconda.organd use the search bar at the top of the page.(base) C:\Users\PC>conda create -n qttest python = 3.8CondaValueError: invalid package specification: =(base) C:\Users\PC>conda create -n qttest python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done==> WARNING: A newer version of conda exists. <==current version: 23.7.4latest version: 24.5.0Please update conda by running$ conda update -n base -c defaults condaOr to minimize the number of packages updated during conda update useconda install conda=24.5.0## Package Plan ##environment location: C:\Users\PC\.conda\envs\qttestadded / updated specs:- python=3.8The following packages will be downloaded:package                    |            build---------------------------|-----------------pip-24.0                   |   py38haa95532_0         2.8 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainpython-3.8.19              |       h1aa4202_0        18.9 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainsetuptools-69.5.1          |   py38haa95532_0        1003 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/mainwheel-0.43.0               |   py38haa95532_0         137 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main------------------------------------------------------------Total:        22.9 MBThe following NEW packages will be INSTALLED:ca-certificates    anaconda/pkgs/main/win-64::ca-certificates-2024.3.11-haa95532_0libffi             anaconda/pkgs/main/win-64::libffi-3.4.4-hd77b12b_1openssl            anaconda/pkgs/main/win-64::openssl-3.0.13-h2bbff1b_2pip                anaconda/pkgs/main/win-64::pip-24.0-py38haa95532_0python             anaconda/pkgs/main/win-64::python-3.8.19-h1aa4202_0setuptools         anaconda/pkgs/main/win-64::setuptools-69.5.1-py38haa95532_0sqlite             anaconda/pkgs/main/win-64::sqlite-3.45.3-h2bbff1b_0vc                 anaconda/pkgs/main/win-64::vc-14.2-h2eaa2aa_1vs2015_runtime     anaconda/pkgs/main/win-64::vs2015_runtime-14.29.30133-h43f2093_3wheel              anaconda/pkgs/main/win-64::wheel-0.43.0-py38haa95532_0Proceed ([y]/n)? yDownloading and Extracting Packages
wheel-0.43.0         | 137 KB    | ############################################################################ | 100%
setuptools-69.5.1    | 1003 KB   | ############################################################################ | 100%
pip-24.0             | 2.8 MB    | ############################################################################ | 100%Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate qttest
#
# To deactivate an active environment, use
#
#     $ conda deactivate(base) C:\Users\PC>conda activate qttest(qttest) C:\Users\PC>pip install PyQt5 -i https://pypi.douban.com/simple
Looking in indexes: https://pypi.douban.com/simple
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/pyqt5/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))': /simple/pyqt5/
ERROR: Could not find a version that satisfies the requirement PyQt5 (from versions: none)
ERROR: No matching distribution found for PyQt5(qttest) C:\Users\PC>pip3 install PyQt5
Collecting PyQt5Downloading PyQt5-5.15.10-cp37-abi3-win_amd64.whl.metadata (2.2 kB)
Collecting PyQt5-sip<13,>=12.13 (from PyQt5)Downloading PyQt5_sip-12.13.0-cp38-cp38-win_amd64.whl.metadata (524 bytes)
Collecting PyQt5-Qt5>=5.15.2 (from PyQt5)Downloading PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl.metadata (552 bytes)
Downloading PyQt5-5.15.10-cp37-abi3-win_amd64.whl (6.8 MB)---------------------------------------- 6.8/6.8 MB 693.9 kB/s eta 0:00:00
Downloading PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 MB)---------------------------------------- 50.1/50.1 MB 460.7 kB/s eta 0:00:00
Downloading PyQt5_sip-12.13.0-cp38-cp38-win_amd64.whl (78 kB)---------------------------------------- 78.3/78.3 kB 544.2 kB/s eta 0:00:00
Installing collected packages: PyQt5-Qt5, PyQt5-sip, PyQt5
Successfully installed PyQt5-5.15.10 PyQt5-Qt5-5.15.2 PyQt5-sip-12.13.0(qttest) C:\Users\PC>

创建新环境—激活环境—安装pyqt5
安装成功会发现一些新的包
   安装成功会出现一些新包

4.Hello World

运行成功截图

关键字:python3.8环境下安装pyqt5

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: