From: Martin C. <cos...@wa...> - 2012-08-26 21:31:46
|
On 26/08/12 20:48, M Hartman wrote: > That's what I'm using is PyCharm and it seems to be so much better than > Eclipse/PyDev, at least for a beginner. Anyway, is that the whole > library in /Lib/site-packages/visual? Does it install anything somewhere > else? Also, I see the visual directory but for some reason, I cannot > import anything from this directory, as I get errors in PyCharms > built-in console. This is the particular error: > > Traceback (most recent call last): > File "C:/Users/airspoon/PycharmProjects/goo/vis.py", line 1, in <module> Is "vis.py" the name of your program? As it appears, this is a bad idea, because vpython has a module named "vis" (in .../site-packages/vis/). This can lead to confusion. > from visual import * > File "C:\Python32\lib\site-packages\visual\__init__.py", line 1, in > <module> > from .visual_all import * > File "C:\Python32\lib\site-packages\visual\visual_all.py", line 1, in > <module> > from vis import version > File "C:\Users\airspoon\PycharmProjects\goo\vis.py", line 3, in <module> Here is the confusion. Instead of importing the "vis" module, which defines box, it opens your vis.py. Box is then undefined. > floor = Box (pos=(0,0,0), length=4, height=0.5, width=4, > color=color.blue) > NameError: name 'Box' is not defined -- Martin |