How is Python 2.7 suddenly a Windows security threat? - python-2.7

I have a python 2.7 anaconda environment (I can't upgrade it to python 3 yet, I hope python2 isn't suddenly viewed a security threat). This python was working fine last week. This morning I come in and try to run some python code in it (that I haven't run before, but came from a contractor of ours).
When I ran it I noticed that (I don't think it was a coincidence) Windows suddenly reported a threat:
and now when I run python, I get:
$ python
bash: /home/username/anaconda3/envs/my_env/bin/python: cannot execute binary file: Exec format error
and when I try to disable the quarantine from Windows Security, I still get that same error.
I'm using Ubuntu Windows Subsystem Linux. I've never seen an error like this before.
Does anybody know what might be causing this problem (or how to recover without rebuilding my environment, assuming that would work)?
Update: I deleted that environment, upgraded Anaconda, and rebuilt my environment (python 2.7) from scratch. It appears to be working again, including what I'd tried before that might have triggered the problem.
I also noticed that my "Virus & threat protection updates" had updated itself 30 minutes before this problem started (at 8:23), and it has since updated again (at 9:45). So perhaps some errant security definition?

Support for Python 2.* ended starting with 2020 (EOL)

Related

Eclipse error during remote debug session: sh: locale: not found

I'm really hoping to get an answer on this. I am using Eclipse to remote debug a C++ program on a (minimal) linux machine. I am aware that the linux machine does not have the locale binary installed. First off, the error received is the following in Eclipse after pressing the debug or run button:
org.eclipse.remote.core.exception.RemoteConnectionException: sh:
locale: not found
After the first run, successive runs do not display the error, only the first run. If I restart the linux machine, the error will come back for the first run again.
What is most obvious is that Eclipse, or the running program is calling locale on the linux machine and it is not available, not installed.
This machine is quite minimal and doesn't even have a package manager - it's an embedded system. So I tried to install "locales", "locale" as well as "locale-all" using multistrap when building the linux image. None worked.
When using debian repositories, multistrap returns
E: Unable to locate packages locales
So I guess my real questions are:
1) What debian package supplies "locale" found in /usr/bin/locale? How
can I install it without adding a lot of of overhead on an ARM system? (assuming no package manager)
2) Where is the source code for locale?
And third,
3) In Eclipse, can I prevent the running program or Eclipse from
calling locale? This is preferred.
After scouring the forums, I found one guy that said he got the same issue and "manually fixed it", however he did not provide the fix.. Hope to get some help!
That reference can be found https://www.eclipse.org/forums/index.php/t/1081283/
Thanks,
I had the same, so I changed the encoding to ISO-8859-1 in the debug settings.

Python IDLE giving startup error

I have just installed kivy in python 2.7.11. After installing it, whenever i try to open IDLE, it is giving subprocess startup error.
Actually i installed kivy on my windows 7 PC through command prompt. After installation, I copied programs of kivy from my android tab to run them on my pc. When I tried to open them, IDLE doesn't respond for some time and after some time it gives startup error. Since then IDLE is not starting .
But it is quite strange that, on running python builtin module, there is no error.
I had reinstalled python but still there is no change.
reason for subprocess startup error can be a new python file that you have created recently with the same name as same existing libraries or module name
e.g. 're.py','os.py' etc
beacuse re,os are the predefined libraries
just go and find the file and rename it
hope so it will be resolved

pyinstaller issue with requests 'ImportError: No module named 'requests.packages.chardet.sys'

I have encountered this issue and tried all previous solutions to no avail. Have tried rolling back requests to older versions, have tried updating pyinstaller. Please guys, if you know a configuration that works, let me know.
I am compiling some python 2.7 code that uses Kivy
I am an idiot. I was piping the wrong python install. I use a separate version for other projects, and I sandbox my kivy one to prevent conflicts... too bad I forgot about that :)

Enthought Canopy: 'pythonw.exe has stopped working'

I am currently running Enthought Canopy version 1.5.2 full version, through an academic license at a 64bit Windows 7. I was a happy user for a couple months until a 'pythonw.exe has stopped working' issue rendered the software useless. This issue shows up when I open the editor (Ipython+Canopy's GUI) and does not allows me to use the software at all. I have tried the following solutions without luck:
Fresh install deleting several folders manually (https://support.enthought.com/hc/en-us/articles/204469700-Uninstalling-and-resetting-Canopy)
Fresh install+clearing python registry keys under hkeys_user and hkey_system and pythonw.exe related keys into windows regedit.exe (Problems in fully uninstalling Python 2.7 from Windows 7)
My second try actually gave me a false sense of victory, when Canopy worked for a couple hours, until the same issue happened taking all hope with it.
I don't know what to do anymore, any help would be much appreciated.
I had this problem also. And discovered it was due to my windows firewall blocking pythonw.exe
Either turn off the firewall. Or create exceptions for pythonw.exe (but be warned this files occurs in a few different directories. And I'm not sure which one gave the specific issue.
In the end I installed a new firewall (COMODO). And now everything works...

Can't run Python via IDLE from Explorer [2013] - IDLE's subprocess didn't make connection

Resolved April 15, 2013.
In windows 7 (64bit) windows explorer when I right clicked a Python file and selected "edit with IDLE" the editor opens properly but when I run (or f5) the Python 3.3.1 program, it fails with the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." error message. All other methods of starting IDLE for running my python 3.3.1 programs worked perfectly.
Even the "Send to" method worked but it was unacceptably clunky. I've spend four days (so far) researching this and trying various things including reinstalling Python many times.
And NO it's not the FireWall blocking it. I've tried totally turning Firewall off and it had no effect.
Here's an important clue: In the beginning I installed and configured python 3.3 64 bit and everything worked including running from "edit with IDLE" but then recently when I needed a library only available in Python 2 I installed python 2.7.4 and from that point on the stated problem began. At one point I completely removed all traces of both versions and reinstalled Python 3.3.1 64 bit. Problem remained.
Then I tried have both 32 bit versions installed but still no luck. Then at some point in my muddling around I lost the option to "edit with IDLE" and spent a day trying everything including editing in Regedit. No luck there either. I reinstalled Python 3.3.1 still no "edit with IDLE" then Finally I uninstalled all versions of Python and I removed python references to environment variables PATH and PYTHONPATH. Then I Deleted all the Python related keys in the windows registry, deleted the C:\python33 directory that the uninstall didn't bother to delete. Overkill, of course, then I restarted windows and installed Python 3.3.1 64 bit version again and thankfully the option to 'edit with IDLE' was back. I was momentarily happy, I opened windows explorer, right clicked on a python program, selected 'edit with IDLE' selected RUN (eyes closed) and you guessed it, same original error message "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection."
I am completely stuck on this issue and really need help. Pretty sure that you can see I and not a happy camper. And to top it all off, I guess I don't understand StackOverflow yet, I have had this plea for help up in various versions for 5 days and not one response from anyone. Believe me I've looked at every thing in stackoverflow plus other sites and I can't see the answer. Almost seems like I have to answer my own question and post it, trouble is, so far I can't.
Anyway, thanks for listening. Yes I'm pretty new to Python but I've been programming and overcoming problems for many years (too many perhaps). anyone? Not personally having someone that is familiar with Python makes this difficult, how can I get in touch with an expert in Python for a quick phone conversation?
I had this same problem today. I found another stack overflow post where someone had a tkinter.py file in the same directory as python, and they fixed it by removing that tkinter.py file. When I looked in my python directory, I realized I had created a script called random.py and put it there. I suspect that it conflicted with the normal random module in python. When I removed this file, python started working again.
So I would suggest you look in your main python directory and see if there are any .py files that you could move to different places.
I'm running Windows 7 64-bit. I saw the same errors today. I tracked down the cause for me, hopefully it'll help you. I had IDLE open in the background for days. Today I tried to run a script in IDLE, and got the "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection." errors. So I closed all IDLE windows, and tried to restart IDLE. That then caused the same errors to pop up, and now IDLE wouldn't open successfully.
The cause was an extra pythonw.exe process running in the background. If I open up an instance of IDLE, then open a second, the second has issues connecting, and closes. But it does not close the instances of pythonw.exe that it opened, one is left running in the background. That extra instance then prevents future attempts to open IDLE.
Opening up Task Manager and killing all pythonw.exe processes fixed IDLE, and now it functions properly on my machine (1 instance open at a time though!).
Look for files on your main python folder that you may create in names like "threading.py", "tkinter.py" and other names that overlapps with your Lib folder and move/delete them
Adding to existing answers - it is actually possible to have firewall block IDLE when not running with -n flag. I haven't used IDLE for a few months and decided to try if it works properly with newly installed python3.3 (on Linux Mint 13 x86). In between I made iptables setup much more aggressive and apparently it blocked idle-python3.3 from connecting to the Python RPC server. Sometimes it is just what the message says.
I had exactly the same issue :"IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess or personal firewall software is blocking the connection."
I found the answer from this stackoverflow site. I created a file named string.py and that classhed with the normal python files. I removed the string.py and everything works now. Thanks folks.
I had the same error message. Error not seen after I added all the *.exe filea to be found in the Python install directory to the Windows firewall exception list.
I finally got it to work when I disabled ALL firewalls and antivirus, because some antivirus ALSO have firewall control. Ex. avast
Remove copy.py in your folder if you happen to have one
Using Windows 7 64 installation of Python 2.7.10 Shell I solved the above problem by opening the program as an administrator.
i have the Same issue on os win7 64Bit and Python 3.1 and find a workaround because i have a Project with many .py files and just one gave this error. - Workaround is to copy a working file and copy the contents from not working file to working file. (i used Another editor as idle. The Problem with that workaround is... of you rename the file it doenst work. attention just rename the not working file doesnt work for me. just that copy paste. – john
I came across this problem too. There are two things you can do
You may already have a process running call pythonw.exe which prevents IDLE from being starting. End that task and try running IDLE again
Use pythonwin or python command line