Import traits error/How to compile the Enought Tool Suite so that I can use chaco in Pycharm?

216 Views Asked by At

Basically, I ran into the error of traits module not showing up. traits.api error in python

Traceback (most recent call last):
  File "C:/Users/x/PycharmProjects/Enthought/.idea/Dynamic Plot.py", line 4, in <module>
    from traits.api import HasTraits, Instance, Int
ImportError: No module named 'traits'

The answer(hopefully correct) says that the tool suite must be compiled. I want to stay with pycharm. Not sure what compileall would do but it doesn't work.

1

There are 1 best solutions below

0
On

There're no problems with PyCharm. Check your imports. If you installed Canopy, then all Enthought libraries should be available through enthought package:

import enthought.traits

Otherwise you should install etsproxy or simply install traits module via pip for direct import:

import traits