I recently updated my yt installation, and I noticed that the current working directory no longer gets added to the module search path when running yt in interactive shell mode. So, if "StarParticles.py" is a file in my current working directory, I can't just type import StarParticles to import that code as a module. I fixed this in my installation by adding: import sys sys.path.insert(0, ' ') to the top of the bin/iyt script, but not sure what the right way to do this more generally is, so I just thought I'd bring this to people's attention. -Andrew Myers
Hi Andrew,
On Fri, Jan 11, 2013 at 7:27 PM, Andrew Myers
I recently updated my yt installation, and I noticed that the current working directory no longer gets added to the module search path when running yt in interactive shell mode. So, if "StarParticles.py" is a file in my current working directory, I can't just type
import StarParticles
to import that code as a module. I fixed this in my installation by adding:
import sys sys.path.insert(0, ' ')
to the top of the bin/iyt script, but not sure what the right way to do this more generally is, so I just thought I'd bring this to people's attention.
You should also be able to get the same behavior by having "." in your PYTHONPATH environment variable. I can't remember if this behavior was changed in yt, or with an updated virtualenv, or something, but I do remember someone else bringing this up recently... -Matt
-Andrew Myers
_______________________________________________ yt-dev mailing list yt-dev@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
participants (2)
-
Andrew Myers
-
Matthew Turk