AttributeError: module 'taichi' has no attribute 'Vector'

i installed taichi using conda today, no cuda version, when i run your demo code in your wechat article, i got:

Traceback (most recent call last):
File “taichi.py”, line 1, in
import taichi as ti
File “/Users/furen/codes/3rd_party/taichi.py”, line 11, in
x = ti.Vector(2, dt=ti.f32, shape=n_particles) # position
AttributeError: module ‘taichi’ has no attribute ‘Vector’

any clue?

Could you share with me the full program output?

Also please let me know how you installed Taichi, and what’s the installed version. Thanks.

i installed taichi under my conda env, in which the python version is 3.7.3, i ran

pip install taichi-nightly

to install taichi, and copy the “99 lines” code exactly to taichi.py, and it seems we have a problem at the very beggining of

import taichi as ti

the output log is

taichi version is taichi-nightly-0.3.20

This is a weird behavior - after importing Taichi you should see an output like

[Taichi version 0.3.20, cuda 10.0, commit dd5cb5ab]

Do you have a similar line in your outputs? Also please let me know if you have previously installed taichi. It seems to be a version conflict… Thanks for your patience

sorry, my bad, i named the script file taichi.py which is exactly taichi’s package name! :joy:

1 个赞

but there is another crash, the full stack output


Taichi is trying to create a Window for visualization yet your env does not have GUI. I guess you are probably using ssh. Please use ssh -XY for X11 forwarding. :slight_smile:

but i’m not using ssh, i ran the script in my mac terminal iTerm2 directly

Interesting. I’ve never seen situation like this. What’s your OS X version?

macOS Catalina 10.15 (19A602)

Oh no, please see this: https://github.com/yuanming-hu/taichi/issues/343
I’ll try to fix it as soon as Travis CI supports Catalina.

i see, waiting for your bugfix :relaxed:

Maybe we should rename taichi.py to any_other_name.py? Python will import the file self instead of the real taichi.

Yes, thank you, i already find that