Python Forum
Error when creating child process on Windows 10
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error when creating child process on Windows 10
#1
Hi,

I've come across an example code below and using PyCharm.

import multiprocessing

def myProcess():
  print("{} Just performed X".format(multiprocessing.current_process().name))

def main():
  childProcess = multiprocessing.Process(target=myProcess, name='My-Awesome-Process')
  childProcess.start()
  childProcess.join()

if __name__ == '__main__':
  main()
When running the program I get the error below.
Error:
File "J:\Programs\Python\Python36\lib\multiprocessing\context.py", line 321, in _Popen from .popen_spawn_win32 import Popen ImportError: cannot import name 'Popen'
The example code was run on Linux but I thought that I could still run the code on Windows.
Is there a workaround?

Thanks for any help.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Question about Creating an Automated Process in Python Supratik1234 0 741 Jan-13-2023, 08:29 PM
Last Post: Supratik1234
  Using one child class method in another child class garynewport 5 1,571 Jan-11-2023, 06:07 PM
Last Post: garynewport
  Failed to execute child process (No such file or directory) uriel 1 1,650 Sep-15-2022, 03:48 PM
Last Post: Gribouillis
  "SSL: CERTIFICATE_VERIFY_FAILED” error on Python 3.9.6 (Windows 10) rcmv 4 3,660 May-10-2022, 01:18 PM
Last Post: rcmv
  Best strategy for creating .exe for windows hammer 4 1,492 Apr-05-2022, 12:47 AM
Last Post: hammer
  Error creating database with python and form? shams 3 2,366 Aug-02-2021, 02:00 PM
Last Post: deanhystad
  error while installing any library using pip in windows AkashKansal 1 4,391 Sep-24-2020, 07:51 AM
Last Post: buran
  Correct py got error on another windows 7 meetinnet 8 3,849 Apr-25-2020, 04:57 PM
Last Post: meetinnet
  Python 3.7, Windows 7, Syntax Error hughdent 1 2,274 Mar-23-2020, 10:09 AM
Last Post: buran
  How to sharing object between multiple process from main process using Pipe Subrata 1 3,654 Sep-03-2019, 09:49 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020