Question

I have got a custom module called subprocess32.py, I have placed this in:

/Python/2.7/site-packages/subprocess32

along with __init.py__

I have tried importing this package / module in a python shell using

from subprocess32 import subprocess32

this works fine I can use the functions etc.

I want to use this module within my goolgle app engine application, I have tried

from subprocess 32 import subprocess32

I get the following error:

No module named subprocess32

I have also tried putting the subprocess32 folder and its contents within the apps folder, and point the sys.path at it before input but no joy.

Any help would be appreciated many thanks.

Was it helpful?

Solution

There's no point installing it in your site-packages directory. That only exists on your local machine, obviously: it won't be included when you deploy and you'd therefore get errors when you tried to import it in production. To prevent you from doing just that, the development server runs inside a sandbox that does not import from that directory either - and it also prevents you from tweaking sys.path.

Instead, just put it inside your project directory and import it from there.

Edit Actually, now I come to think of it, I don't think this will help you. You don't say what your subprocess32 module does, but if it's in any way related to the standard subprocess module, you simply won't be able to use it on GAE. There is no system for you to shell out to, and no way to execute arbitrary commands. You probably need to explain exactly what you're trying to do with that module.

OTHER TIPS

Assuming that your subprocess32 is valid python module. You should copy and paste this subprocess32 module to your project root directory. And then try to import it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top