Getting a Process.start() error pickle.PicklingError: Can't pickle <type 'module'>: it's not found as __builtin__.module with Python 2.7

Liste des GroupesRevenir à cl python 
Sujet : Getting a Process.start() error pickle.PicklingError: Can't pickle <type 'module'>: it's not found as __builtin__.module with Python 2.7
De : mk1853387 (at) *nospam* gmail.com (marc nicole)
Groupes : comp.lang.python
Date : 02. Sep 2024, 15:00:15
Autres entêtes
Message-ID : <mailman.27.1725285631.2917.python-list@python.org>
References : 1
Hello,

I am using Python 2.7 on Windows 10 and I want to launch a process
independently of the rest of the code so that the execution continues while
the started process proceeds. I am using Process().start() from Python 2.7
as follows:

from multiprocessing import Process
def do_something(text):
    print(text)
if __name__ == "__main__":
    q = Process(target=do_something,args=("somecmd") )
    q.start()
    # following code should execute right after the q.start() call (not
until it returns)
    .....


But getting the error at the call of Process().start():
pickle.PicklingError: Can't pickle <type 'module'>: it's not found as
__builtin__.module

anybody could provide an alternative to call the function do_something() in
a separate thread ?

Date Sujet#  Auteur
2 Sep 24 * Getting a Process.start() error pickle.PicklingError: Can't pickle <type 'module'>: it's not found as __builtin__.module with Python 2.72marc nicole
2 Sep 24 `- Re: PicklingError1Stefan Ram

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal