I am new to Python and recently installed Python 3.6 on Windows 10. When I try to open IDLE, Python's IDE, I keep getting a message saying that it can not establish a subprocess. I have tried uninstalling and installing several times. I have seen several forums which say that there could be a .py file that is in the directory that is messing up IDLE. This is not my case, as I have not even been able to start using Python and I do not have a firewall either. Can someone tell me how I can get IDLE to work?
In this answer I collected together 9 possible reasons for the message, as reported in various SO answers.
If you try to start IDLE from a command line (Command Prompt or PowerShell)
> python -m idlelib # idlelib.idle for 2.x
one might get a helpful error message.
I work with over 30 Python developers and without fail when this happens they were behind a proxy / vpn. Turn off your proxy / vpn and it will work. Must have had this happen hundreds of times and this solution always worked.
Related
I'm lost with Python. After troubleshooting with a friend through Discord for literally months I am about to give up. This is my last attempt at trying to get Python fixed on my Windows 10 laptop.
I'm using a Lenovo Legion 5, bought the laptop in November 2020. I've not been able to get anything related to Python to run in the CMD window. I can run Python no problem, but nothing I have installed through pip has ever worked. I can use virtualenvs, but only through PyCharm for example. Python has never really worked through the command line.
Yes I tried reopening the CMD window, rebooted the system many times, ran the CMD as administrator, installed the path variables for both Python and esptool.py but nothing seems to help.
I honestly don't know where to start because none of the 250+ websites I've visited to so far that suggested a fix for any kind of issue I've been experiencing with Python has been working. I can run Python fine by the way, just none of the things installed through pip will work.
Let's start with a use-case:
I'm trying to run esptool.py so installed it with pip install esptool. This install worked fine, and I can confirm it is installed with pip show -f esptool.
However, when running esptool.py version it told me:
'esptool.py' is not recognized as an internal or external command, operable program or batch file.
So I added the local folder from the previous step to the %PATH% variables, after running esptool.py version it gave me a popup asking me with what kind of program I should open this, I didn't select to open with this kind of program from now on. This makes it so that I do not get an error, what now happens is that another window quickly opens and then exits without an error code. So I have no clue what's happening.
What should happen is that it should tell me which version is installed in the CMD window.
There have been a few other things going on with my Windows 10 install, for one, the username that I used during the installation wasn't used to create the user directory. Windows 10 somehow instead chose a name that was related to the first 5 characters of my email address, which is totally strange as I haven't used that string in the installation of Windows 10 at all. This was a fresh install on a new laptop.
Now, after an update of Win10 my user icon doesn't display anymore and I had to change ownership of the 'Windows Apps' folder in order to be able to access it. Changing the ownership also changed the name I now see on the login screen when I boot up the laptop. It changed from the 5 first chars of my email address to my full name in the login screen, only because I took ownership of this folder so I could access it.
There have been a lot of things going on that I think should not be changing all the time, things to do with administrator rights, ownership, etc.
Now, since opening esptool.py doesn't open it, but also doesn't show me an error, I'm clueless and the only thing I can think of is doing a fresh system install, but I have a bunch of projects going on for which I need this laptop in working order and I don't have the mental health (due to corona) left to do a fresh system install. I'm worn down. Not in a dramatic way, I just don't have the spare energy to go through the whole process. So I'm hoping someone can point me in the right way to troubleshoot why my Python doesn't want to work natively.
What happens when running esptool.py version is that I can see it opens a Python window, but without showing any content it closes within a few milliseconds.
What is going on, how do I continue? I hope someone knows how to troubleshoot my system, to find the core of the problem.
It apparently was rather simple. First of all, thanks for the replies! And second of all, thanks for pointing me to superuser.com I wasn't aware of the site and will continue there.
The fix was to use python -m pip install esptool as suggested by Valentin Kuhn.
To answer AKD, I have a lot of experience with programming on my MacBook, but I'm not experienced with actually maintaining the system side, I'm a creative user. It's just that ever since I got a Windows laptop it's been nothing but trouble and after months of chatting about each individual issue with people on Discord nobody has been able to find a solution. I'm not expecting a GUI, just a simple "esptool.py v3.0" was the answer I was expecting from the command line.
Now what I don't understand is that I've never found any hint to anyone suggesting python -m. I will get on superuser to find out more about why the standard instructions that work for most people, don't work for me.
Sorry for using the wrong site for my question, I came on here through another related question and it was past my bedtime and I wasn't thinking clear.
I have tried uninstalling it and have searched other answers. None of them have worked; IDLE opens, but I can't run anything I write.
In Windows 10
1. Type in "Controlled folder Access"
2. Select "Allow an app through Controlled folder access" Select yes to "UAC"
3. Click on "+ Add an allowed app"
4. Select "recently blocked apps"
5. Find the executable for the C:\Python27
6. Click the + to add it.
7. Select Close
Then try running the Python Shell again. This worked for me 100%
Also, add exception through Windows Firewall Python27 select Private and Public.
This question has been asked before. Based on previous answers, I compiled a list of possible causes and solution on CPython tracker issue 25514, post of 2016-01-18.
SO question 1 Causes people have found or think they have found.
Antivirus/firewall (4 people, linux iptables, Windows firewall, antivisus , so not a myth ;-)
Shadow files, as described [in the issue], and in the python directory (about as common; example user file names: tkinter,py, subprocess.py).
Registry problem (some people can fix, but most should re-install after complete removal).
Zombie pythonw process (kill with Windows Task manager).
Permissions (run as admin, though should not be needed with proper install)
?Multiple installed versions clash due to misconfiguration?
SO question 2 Add:
Running after stopping run with ^C (temporary, I believe Restart Shell will fix) Call this a timing issue. I have experienced temporary connection failures myself.
Modem reboot (rather obsolete answer for most of us).
?example program that reads and writes (test)
Someone somewhere reported that his problem was with network misconfiguration that affected the operation of the socket module that IDLE uses.
Last resort: start IDLE with -n command line option, as described in IDLE doc.
If you at the network environment then check on the secure Group (SG), to see if the user is listed under that group.
else as other had been suggested you have to have the (right click on the program the login as Admin right to enable the IDLE to run.
IDLE's subprocess didn't make a connection. Either IDLE can't start or a personal firewall software is blocking the connection.
Having had this problem myself I did an uninstall and created a new directory in the C drive and reinstalled in that folder, which worked for me.
First uninstall the application.Then reinstall it BUT at the time of reinstallation try -n at the end of location adress. It worked for me, you can copy the below text and paste it at the location while installing it.
“C:\Program Files\Python32\pythonw.exe” lib\idlelib\idle.py -n
I'm receiving the message:
The program can't start because python34.dll is missing from your computer. Try reinstalling the program to fix this problem.
I want to use python27, so I uninstalled python34, but can't get the cmd prompt to redirect to the python27 .dlls.
In the prompt I typed setx PATH "c:\python27" and it says successful. I close out of the prompt, open it again, type Python, and I get the same message.
Here is a screenshots of the error:
And a screenshot of the response to the setx command:
How can I fix this?
I would suggest you manually edit your PATH (through Windows' GUI instead of CMD) and ensure two things:
a) That C:\python27 is in there and
b) That C:\python34 is not in there
Also, after doing that, make sure you close all open cmd.exe dialogs before opening a new one and testing again.
CMD is a bit weird in my experience, it seems like as long as one instance of it is running, Windows won't propagate environment variable changes to any instances of it (even new ones created after the change). I wasted a lot of time in the past troubleshooting issues similar to yours until I figured that out, so I think it's worth mentioning here.
I am trying to install python 3.3.4 for the first time on Win Vista OS and it seems to install successfully but when I try to open the IDlE gui I get the error msg: IDLE subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection.
I have tried uninstalling and reinstalling, have tried turning off the firewall completely and have had no luck getting this to work. Everything I have read from people having similar problems is because they had a file in the wrong place or something similar. I have never used this program before, I haven't even been able to open it once so if there is a bad file then it lies with the installation process.
Someone please help, I am completely new to this and would very much like to learn to program with Python.
although I have been using python a long time very easily in a Linux environment, I have tremendous trouble to even install it correctly in a windows environment. I hope this is a question to be asked here, as it is not directly a programming question.
Especially, I have the following problems:
When on the command line, python is not a recognized command. Do I have to set the Windows path manually myself? If so, how to do that?
When starting a python script, should this be done with python.exe or pythonw.exe? What is the difference?
I also tried to install ipython several times, it never got installed (even after following the starting ipythonenter link description here thread.
When starting a script with python.exe, a window pops up and closes immediately. I saw some hints in putting in a readline command, which is of no help if there is a syntax error in the script. So how to be able to keep the window open, or how to run the command on the cmd.exe?
Thank you for any help on these items.
Alex
1) Look here: www.computerhope.com/issues/ch000549.htm
2) It has already been answered, always try to use search before asking question:
pythonw.exe or python.exe?
4) When using cmd.exe just navigate to your script folder using dir for changing directories and C:,D:,etc. for changing drives. Then run script by typing just the script name. When installed correctly, Python automatically launches .py scripts with python, so you don't have to write 'python' before script name. When run in cmd, window will stay open. If you want it to stay open even when launching script with double-click, use function waiting for user input, see here How to keep a Python script output window open?
You might want to use Python3.3, there is a new launcher for Python scripts in it. By that, you can start Python scripts with py <scriptname> which has the benefit of being installed in your path (C:\Windows\system32) and you can use a shebang to tell whether the script is for Python2 or Python3.
Also
In addition to the launcher, the Windows installer now includes an
option to add the newly installed Python to the system PATH
(contributed by Brian Curtin in issue 3561).