解决python使用命令安装不上wxpython问题

问题1:building wheels for collected packages: wxpython   building wheel for wxpython (setup.py) ... error   error: subprocess-exited-with-error    × python setup.py bdist_wheel did not run successfully.

问题2:error: could not install packages due to an oserror: [winerror 123] 文件名、目录名或卷标语法不正确。: 'd:\x08oy'

问题1分析:

翻译

为收集的包构建轮子:wxpython 为 wxpython 构建轮子 (setup.py) ...错误错误:× Python setup.py bdist_wheel 未成功运。

前提须知:是否python包中没有升级对应的安装包,pip, setuptools 

为了排除这个因素:先升级

D:\boy\python.exe -m pip install --upgrade pip
D:\boy\python.exe -m pip install --upgrade setuptools

D:\boy\python.exe为 python安装路径

升级完,再执行pip install --user --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ wxpython

还是不行。那就不是前面两个包版本太低的原因。

网上查了资料发现。是python版本与最新的wxpython不兼容导致的。我的python版本的还是3.7.

两种思路:要不就是将你的python3.7也升级到最高版本,这样就可以和最新的wxpython兼容了。

另一种思路。就安装你现在版本对应的wxpython版本。这样也可以兼容。

我选择的是第二种。

于是我去官网找:https://pypi.org/project/wxPython/

或者wxPython · PyPI

有点一头雾水,最新的是wxPython 4.2.2。

我要找python3.7对应的版本,没找到。只能从另一个博客中得知是wxPython-4.1.0

如果要找就找cp37对应的就是python3.7的意思

找到后就用命令。安装

pip install --user --index-url https://pypi.tuna.tsinghua.edu.cn/simple/  wxPython==4.1.0
这里用的user权限。所以就出现第二个问题了。

问题2的解决思路就是用管理员权限。不用user

也就是去掉user

pip install   --index-url https://pypi.tuna.tsinghua.edu.cn/simple/  wxPython==4.1.0
这样两个问题就解决了。

参考了一下博主的文章。非常感谢。终于把我的问题解决了

已解决error: subprocess-exited-with-error-CSDN博客

解决Building wheel for wxPython (setup.py) ... error ERROR: Command errored out的具体操作步骤_mob649e8155edc4的技术博客_51CTO博客

【wxPython导入失败】Failed building wheel for wxPython_error: failed building wheel for wxpython-CSDN博客【Python问题解决】---- ERROR: Could not install packages due to an OSError: [WinError 2] 系统找不到指定的文件。-腾讯云开发者社区-腾讯云

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值