App engine import multiprocessing error

1,041 views
Skip to first unread message

tao hong

unread,
Feb 10, 2014, 3:20:53 PM2/10/14
to google-a...@googlegroups.com
I would like to use `multiprocessing` library for my site. However, I ran into some import error in the local test environment. Can I have any suggestions on how to fix this issue? or I have to use `threading` library  instead of `multiprocessing`. Thanks!

Below is the traceback information.

    ERROR    2014-02-10 19:34:52,315 cgi.py:121] Traceback (most recent call last):
    
      File "D:\Dropbox\ubertool_src\przm/przm_batchoutput.py", line 23, in <module>
    
        import multiprocessing
    
      File "C:\Python27\Lib\multiprocessing\__init__.py", line 65, in <module>
    
        from multiprocessing.util import SUBDEBUG, SUBWARNING
    
      File "C:\Python27\Lib\multiprocessing\util.py", line 40, in <module>
    
        from subprocess import _args_from_interpreter_flags
    
    ImportError: cannot import name _args_from_interpreter_flags

Vinny P

unread,
Feb 10, 2014, 6:09:28 PM2/10/14
to google-a...@googlegroups.com
On Mon, Feb 10, 2014 at 2:20 PM, tao hong <hongt...@gmail.com> wrote:
I would like to use `multiprocessing` library for my site. However, I ran into some import error in the local test environment. Can I have any suggestions on how to fix this issue? or I have to use `threading` library  instead of `multiprocessing`. Thanks!


You're better off using the backported concurrent.futures; see here for more information: https://groups.google.com/forum/#!msg/google-appengine/TpIUau1Ikp8/4A9fK_DbodgJ 

What in particular are you using threading for? If you're using threading to access App Engine services, you may want to look into using async functions (for instance, using db.put_async over db.put).
 
 
-----------------
-Vinny P
Technology & Media Advisor
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

timh

unread,
Feb 10, 2014, 7:20:05 PM2/10/14
to google-a...@googlegroups.com
You can't use multiprocessing on appengine.  Multiprocessing is for creating and coordinating sub processes for parallelism.
That is not an option on appengine.  Appengine has other facilities like async methods, task queues and backends (which can use traditional threading).

You will need to rethink your plans in terms of the facilities that appengine provides.

T

pdknsk

unread,
Feb 11, 2014, 4:06:58 PM2/11/14
to google-a...@googlegroups.com
You can't use multiprocessing, but threading works just fine. I haven't tried, but you might be able to use multiprocessing.dummy instead.

Reply all
Reply to author
Forward
0 new messages