离线安装wxpython

这篇博客介绍了如何在离线环境中手动安装wxpython。首先确保安装了python2.7,接着下载wxpython的whl文件,将其放在python安装目录的Scripts文件夹下。通过pip尝试安装时遇到不支持的平台错误,解决办法是先用pip安装six,再使用easy_install完成wxpython的安装。最后,通过测试导入wx包来确认安装成功。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

前言

由于工作环境,我的工作机是在离线环境下的,没法连接外网。但是自己又想学习一下wxpython,只好自己手动离线安装,本来以为很简单的,但是实际上。。。一言难尽。

基本环境:python pip easy_install

安装python2.7

直接下载msi数据包安装,如果无法识别安装,那么:

  • 1、确定msi数据包的完整性,包括大小、格式;

  • 2、确定开启开启windows installer:win + R –> 输入Services.msc –> 找到windows installer –> 左侧手动启用

python3.X 安装更为简单,直接双击.exe文件安装即可,且都需要选定添加环境变量。

安装wxpython

1、下载

下载地址:https://pypi.org/project/wxPython/4.0.1/#files
选择对应的文件进行安装,我的选择是: wxPython-4.0.1-cp27-cp27m-win_amd64.whl

其中:

cp27 表示 python2.7

win_amd64 表示 windows 64位

在这之外:win32 表示 32位

2、安装

将下载好的wxpython**.whl文件转移到python安装路径下的Scripts目录下,我的是:C:\Python27\Scripts
然后打开cmd或者powershell,切换到该目录下:

PS C:\User\Yanta> cd C:\Python27\Scripts

执行命令 pip install wxPython-4.0.1-cp27-cp27m-win_amd64.whl ,此时会报错:wxPython-4.0.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

PS C:\Python27\Scripts> pip install .\wxPython-4.0.1-cp27-cp27m-win_amd64.whl
wxPython-4.0.1-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

此时可以尝试使用easy_install安装,结果提示缺少 six 包。

PS C:\Python27\Scripts> .\easy_install-2.7.exe .\wxPython-4.0.1-cp27-cp27m-win_amd64.whl
Processing wxPython-4.0.1-cp27-cp27m-win_amd64.whl
c:\python27\lib\site-packages\setuptools\pep425tags.py:89: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:93: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect
  warn=(impl == 'cp')):
c:\python27\lib\site-packages\setuptools\pep425tags.py:99: RuntimeWarning: Config variable 'Py_UNICODE_SIZE&#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值