0
votes

Usually I would use virtualenv and pip for deployment of web applications. With Google App Engine this doesn't work, because all import statement are relative to directory of the application.

The most common approach I saw was to simply copy the packages from site-packages to the directory of the application. This involves manual work and is error-prone.

Another approach was to changes install_lib and install_scripts in ~/.pydisutils.cfg, but this doesn't allow me to use pip in my home directory simultaneously.

Do you have any suggestions for this?

2

2 Answers

2
votes

It seems manually adding the virtualenv to sys.path solves the problem for me at the moment:

sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'dev.env/lib/python2.5/site-packages/'))
0
votes

If you use easy_install instead of pip you can run it with the --install-dir argument to specify a non-default installation directory.