rlguy / GridFluidSim3D

A PIC/FLIP fluid simulation based on the methods found in Robert Bridson's "Fluid Simulation for Computer Graphics"
zlib License
786 stars 95 forks source link

cannot import name FluidSimulation #11

Closed thejmazz closed 8 years ago

thejmazz commented 8 years ago

build worked fine, so not sure if I am missing something? image

In the mean time I can try to use C++, but I'm not too sure how to compile that. What I attempted:

g++ example_hello_world.h -o hello-world

which gave errors.

Edit nvm, figured out how to use main.cpp :)

rlguy commented 8 years ago

Hello thejmazz,

The Python scripts in the examples need to be passed the directory that contains the 'pyfluid' package. This is so that Python knows where to search when importing the package. The pyfluid package is located in the build/fluidsim/ directory, so the following command should work:

python example_hello_world.py ../../../build/fluidsim/

It's an easy mistake to make, and you almost had it right. I suppose that the wording in the ImportError message could be unclear and easily misinterpreted, so I'll change it to something better.

Hope this helps!

Best Regards, Ryan

thejmazz commented 8 years ago

ahh that makes sense. cheers!