无法在 windows、python 上安装特征
Can't install traits on windows, python
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)
我搜索了错误信息,得到了一些结果,但是none个解决了问题,所以我安装了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 上安装特征?
您可以通过安装 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 点。如果不确定,可以通过在命令行 (cd C:\Python34\Scripts
) 和 运行ning
中更改目录直接 运行 pip.exe
pip.exe install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl
编辑:您考虑过使用 Qt5
吗?
Windows 10 64位
我在python3.52
中通过pip成功安装了traitsuiQt4 必须安装才能在 windows 上显示 GUI,但是 python Qt4 支持的最高版本是 python3.4
所以,当我尝试通过 pip
安装 traits 时,我安装了 python3.4我收到错误消息:
error: Microsoft Visual C++ 10.0 is required (Unable to find vcvarsall.bat)
我搜索了错误信息,得到了一些结果,但是none个解决了问题,所以我安装了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 上安装特征?
您可以通过安装 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 点。如果不确定,可以通过在命令行 (cd C:\Python34\Scripts
) 和 运行ning
pip.exe
pip.exe install C:\whereveryourfileis\traits-4.6.0.dev0-cp34-cp34m-win32.whl
编辑:您考虑过使用 Qt5
吗?