On Thu, November 30, 2006 8:59 pm, belinda thom said: > Hi, > > There is a discussion of how to "use pyro from w/in python" that I'd > like to pursue for programming non-robotic ML-experiments: > > http://emergent.brynmawr.edu/emergent/PyroFromPython? > action=highlight&value=pyro+from+python > > However, I'm uncertain how I should modify my Python environment to > be able to find things like: > > from pyrobot.brain.conex import Network. > > I'd like to have the ability to start python from anywhere and have > it have access to Pyro's modules. Perhaps the PYTHONPATH env variable > could be used. I'm not sure what modules in the pyro distribution > would need to be added (or how to add them).
Most of Pyro just depends on the normal Python importing mechanism: To import a module, Python looks: 1. in the installed location, usually someplace like /usr/local/python24/site-packages/ You can, of course, put the pyrobot directory there, and you'll be fine. Or: 2. in the current directory. You can have the pyrobot dir in the current dir. (This method may be going away in future versions of Python) Or: 3. in the PYTHONPATH env variable. This can be a list of places where you have your modules sprinkled throughout. In addition to the path, there are a few Pyro modules that need to find some specific files in the pyrobot dir. To allow Pyro to find itself, you just need to define the env variable PYROBOT. For example, if you have pyrobot in your home directory you could do this in bash: export PYTHONPATH=$PYTHONPATH:/home/yourid export PYROBOT=/home/yourid/pyrobot One other tidbit: don't rename the "pyrobot" directory to something else; somewhere it assumes that it is really called "pyrobot". Follow these hints, and you should never have a problem. :) -Doug > Advice? > > Thanks, > --b > _______________________________________________ > Pyro-users mailing list > [email protected] > http://emergent.brynmawr.edu/mailman/listinfo/pyro-users > -- Douglas S. Blank Associate Professor, Bryn Mawr College http://cs.brynmawr.edu/~dblank/ Office: 610 526 601 _______________________________________________ Pyro-users mailing list [email protected] http://emergent.brynmawr.edu/mailman/listinfo/pyro-users
