4

Windows 10 64bit

I installed traitsui successfully by pip in python3.52

Qt4 must be installed to display GUI on windows, But the highest version of python Qt4 support is python3.4

So, I install python3.4, when I try to install traits by pip

I got error message:

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

Unable to find vcvarsall.bat

I search the error message, get some results, But none of them solve the problem, So I install mingw

use pip to install traits again, get another error

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

Is there a way to install traits on windows in python 3.4?

ƘɌỈSƬƠƑ
  • 6,538
  • 7
  • 30
  • 56
zpoint
  • 121
  • 1
  • 8

1 Answers1

4

You can circumvent the problem of the error with Visual Studio C++ by installing a precompiled version of the package in form of a wheel. You can find wheel packages for most of the common modules here.

Download the file traits-4.6.0.dev0-cp34-cp34m-win32.whl (cp34 indicates Python 3.4, win32 that your Python is 32bit) and install it using the command line:

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

Make sure that pip is linked to your Python 3.4 pip. If you are unsure, you can run the pip.exe directly by changing your directory in the command line (cd C:\Python34\Scripts) and running

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

Edit: Did you consider using Qt5?

Ian
  • 1,560
  • 14
  • 33
  • Thank you very much. I reinstall the 32 bit python version and use the wheel packages, It finally works. Of course I want to use Qt5, but I don't think traitsUI support Qt5. And sorry to bother you again, I use 'pyinstaller' to pack the first example of [traitsui_doc](https://docs.enthought.com/traitsui/traitsui_user_manual/view.html) and get [error_messege](http://i.stack.imgur.com/S1oXu.png) But works well when I type 'python t.py' in command line, I wonder if I can pack the traitsUI example to exe file on windows? – zpoint Jul 08 '16 at 19:10
  • Glad I could be of help. On your second matter I advise you to open another question. I am afraid I can't help you with `pyinstaller` problems. – Ian Jul 11 '16 at 06:20
  • doesn't work for me :\ ... says "ERROR: traits-6.1.1-cp39-cp39-win32.whl is not a supported wheel on this platform." tried the one for 64, didn't work either – Raksha Nov 29 '20 at 19:54
  • @Raksha What platform (Win 32/64?) and python version are you using? Do you maybe have another python installation and pip is actually coming from that? Navigate to your python folder and execute pip.exe directly from the command line. – Ian Nov 30 '20 at 11:01