Windows 10 64 位
我在python3.52中通过pip成功安装了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)
我搜索了错误信息,得到了一些结果,但都没有解决问题,所以我安装了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
有没有办法在 python 3.4 的 windows 上安装 traits?
最佳答案
您可以通过以 wheel
的形式安装包的预编译版本来避免 Visual Studio C++ 的错误问题。您可以找到大多数常用模块的 wheel
包 here .
下载文件traits-4.6.0.dev0-cp34-cp34m-win32.whl
(cp34
表示Python 3.4,win32
表示你的 Python 是 32 位的)并使用命令行安装它:
pip install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl
确保 pip
链接到您的 Python 3.4 pip。如果不确定,可以通过在命令行中更改目录 (cd C:\Python34\Scripts
) 并运行
pip.exe
pip.exe install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl
编辑:您是否考虑过使用 Qt5
?
关于python - 无法在 windows、python 上安装 traits,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38261366/