Rectangle 27 4

The thing is "python.exe" is being obstructed by "tkinter.py") that you created(i.e., you have written a program with Tk() and named it as tkinter.py and saved that in the root folder of python). And that's it just make sure that you don't save any program file directly in the root folder of python.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 4

The thing is "python.exe" is being obstructed by "tkinter.py") that you created(i.e., you have written a program with Tk() and named it as tkinter.py and saved that in the root folder of python). And that's it just make sure that you don't save any program file directly in the root folder of python.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 1

I had the same problem. what i did that solved it, was to move every .py file that i had created in "C:\Python33" folder, to a sub-folder that i named "Examples". seems like one of my files was the cause of this problem.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 1

I had the same problem. what i did that solved it, was to move every .py file that i had created in "C:\Python33" folder, to a sub-folder that i named "Examples". seems like one of my files was the cause of this problem.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 7

As Piotr mentioned, PyCharm 'Attach to subprocess automatically while debugging'. If subprocess is a Python process, PyCharm debugger change the process's startup arguments (see function patch_args at source). When you start subprocess in this way:

args = ['python',
        '-m', 'pycharm-multiprocess-debug',
        'worker']
worker = subprocess.Popen(args)

The actual startup command is like:

python.exe -m "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.3\helpers\pydev\pydevd.py"
--multiproc --client 127.0.0.1 --port 62661
--file pycharm-multiprocess-debug

So it went wrong. There are several workarounds I can find:

easiest way, if you don't need to debug subprocess, just turn off "Attach to subprocess automatically while debugging" inside PyCharm settings

args = ['python', '__main__.py', 'worker']

The disadvantage is you can only run a Python file, not a Python module.

  • I recommend the last solution for Python subprocess: from multiprocessing import Process def server(): p = Process(target=worker) p.start() print 'worker pid: {}'.format(p.pid) p.join()

The second solution solved the issue.

where should I write that code?? args = ['python', 'main.py', 'worker']

args

python - Debugging Popen subprocesses with PyCharm - Stack Overflow

python multiprocessing pycharm
Rectangle 27 0

I also had the following problem. My file was named code.py, and was working fine untill I installed Canopy, and numpy.

I tried reinstalling python, but what solved the problem for me was simply renaming the file. I called my file myCode.py, everything started working fine. Strange problem...

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

I had the same problem. what i did that solved it, was to move every .py file that i had created in "C:\Python33" folder, to a sub-folder that i named "Examples". seems like one of my files was the cause of this problem.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

As Piotr mentioned, PyCharm 'Attach to subprocess automatically while debugging'. If subprocess is a Python process, PyCharm debugger change the process's startup arguments (see function patch_args at source). When you start subprocess in this way:

args = ['python',
        '-m', 'pycharm-multiprocess-debug',
        'worker']
worker = subprocess.Popen(args)

The actual startup command is like:

python.exe -m "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.0.3\helpers\pydev\pydevd.py"
--multiproc --client 127.0.0.1 --port 62661
--file pycharm-multiprocess-debug

So it went wrong. There are several workarounds I can find:

easiest way, if you don't need to debug subprocess, just turn off "Attach to subprocess automatically while debugging" inside PyCharm settings

args = ['python', '__main__.py', 'worker']

The disadvantage is you can only run a Python file, not a Python module.

  • I recommend the last solution for Python subprocess: from multiprocessing import Process def server(): p = Process(target=worker) p.start() print 'worker pid: {}'.format(p.pid) p.join()

The second solution solved the issue.

where should I write that code?? args = ['python', 'main.py', 'worker']

args

python - Debugging Popen subprocesses with PyCharm - Stack Overflow

python multiprocessing pycharm
Rectangle 27 0

I had the same problem and noticed something quite interesting. I had accidentally named a file (inside the desktop folder I was working in) "tkinter" (it will cause the same problem if you rename a file by any reserved keyword, I assume). Everytime I ran or attempted to run this file, it created a pycache folder, and the error you mention above came up. Deleting the erroneously named python file solved the problem.

So - look for ANY files (in the folder you are working with or indeed the root folder) that are named after any reserved words. Delete them. Hopefully it'll work!

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

I had the same problem and noticed something quite interesting. I had accidentally named a file (inside the desktop folder I was working in) "tkinter" (it will cause the same problem if you rename a file by any reserved keyword, I assume). Everytime I ran or attempted to run this file, it created a pycache folder, and the error you mention above came up. Deleting the erroneously named python file solved the problem.

So - look for ANY files (in the folder you are working with or indeed the root folder) that are named after any reserved words. Delete them. Hopefully it'll work!

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

The thing is "python.exe" is being obstructed by "tkinter.py") that you created(i.e., you have written a program with Tk() and named it as tkinter.py and saved that in the root folder of python). And that's it just make sure that you don't save any program file directly in the root folder of python.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

I also had the following problem. My file was named code.py, and was working fine untill I installed Canopy, and numpy.

I tried reinstalling python, but what solved the problem for me was simply renaming the file. I called my file myCode.py, everything started working fine. Strange problem...

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

I had the same problem and noticed something quite interesting. I had accidentally named a file (inside the desktop folder I was working in) "tkinter" (it will cause the same problem if you rename a file by any reserved keyword, I assume). Everytime I ran or attempted to run this file, it created a pycache folder, and the error you mention above came up. Deleting the erroneously named python file solved the problem.

So - look for ANY files (in the folder you are working with or indeed the root folder) that are named after any reserved words. Delete them. Hopefully it'll work!

good answer. Had the problem with "random". ;)

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

The thing is "python.exe" is being obstructed by "tkinter.py") that you created(i.e., you have written a program with Tk() and named it as tkinter.py and saved that in the root folder of python). And that's it just make sure that you son't save any program file directly in the root folder of python.

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle
Rectangle 27 0

I also had the following problem. My file was named code.py, and was working fine untill I installed Canopy, and numpy.

I tried reinstalling python, but what solved the problem for me was simply renaming the file. I called my file myCode.py, everything started working fine. Strange problem...

python - IDLE subprocess startup error - Stack Overflow

python python-2.7 python-idle