无法在Windows上安装特征,python

时间:2016-07-08 07:41:54

标签: python traits traitsui

Windows 10 64位

我在python3.52中成功安装了traitsui

必须安装Qt4才能在Windows上显示GUI,但python Qt4支持的最高版本是python3.4

所以,当我尝试通过pip

安装traits时,我安装了python3.4

我收到错误消息:

error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)

Unable to find vcvarsall.bat

我搜索错误消息,得到一些结果,但没有一个解决问题,所以我安装 mingw

使用pip再次安装traits,得到另一个错误

collect2.exe: error: ld returned 1 exit status
error: command 'D:\\Program Files\\mingw-w64\\x86_64-5.3.0-win32-seh-rt_v4-rev0\\mingw64\\bin\\gcc.exe' failed with exit status 1

collect2.exe: error

有没有办法在python 3.4中的Windows上安装traits?

1 个答案:

答案 0 :(得分:2)

您可以通过以wheel的形式安装软件包的预编译版本来规避Visual Studio C ++的错误问题。您可以找到大多数常见模块herewheel个包。

下载文件traits-4.6.0.dev0-cp34-cp34m-win32.whlcp34表示Python 3.4,win32,你的Python是32位)并使用命令行安装它:

pip install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl

确保pip链接到Python 3.4点。如果您不确定,可以通过在命令行(pip.exe)中更改目录并运行

来直接运行cd C:\Python34\Scripts
pip.exe install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl

编辑:您是否考虑过使用Qt5