Python IDLE wont' start (Mac) - Problems from a Python/Unix newbie - python

Months ago, I installed Python 2.7 on my MacBook Pro (OS 10.8.5) and was using IDLE to run programs for classes I was taking on Udacity. One morning IDLE would no longer start, it would just bounce around on the dock and then close. I was eventually able to get things working again by installing Python 3.3 and using that IDLE.
A few days ago, I tried to get 2.7 working again by uninstalling all versions of Python and reinstalling using Macports. (To uninstall, I simply deleted the Python folders in my application folder, the Python.framework file in /Library/Frameworks and some symlinks in /usr/local/bin. Got the idea from another post here: How to uninstall Python 2.7 on a Mac OS X 10.6.4?)
Now no version of Python is working for me. When I try to start IDLE, I get the following error message in the Console:
2/7/14 10:28:02.556 PM com.apple.launchd.peruser.502[151]: ([0x0-0xc80c8].org.python.IDLE[819]) Exited with code: 1
The Python in the terminal still works, by the way. I also tried installing another IDE, PyCharm, but that doesn't work either (I get a message saying No Python interpreter selected)

If you are using a MacPorts Python, you will need to install the corresponding py*-tkinter port to use any Tkinter-based Python app, including IDLE. Try:
sudo port install py27-tkinter

Related

python Idle stopped working after Win10 update

Win10 64 bit, Dell XPS13.
A couple of months ago I wrote and continued to run a simple Python program under IDLE 3.7. On 2nd October, this worked fine. On the night of the 2nd, Win10 update to version 1909 ran. (There is a message that the latest update 2004 failed to install in August.) Since then the first line, #!/usr/bin/env python3, gives an invalid syntax error. Microscoft chat help suggested I reinstall Python. So I unistalled 3.7 and tried to install 3.8 from the Python website. This suggested I install the 32 bit, but I found the 64 bit version so downloaded and installed that. Still the same error. Uninstalled that, then installed the recommended 32 bit version.
When I click on my program with a .py extension, the program does not run. If I load IDLE, load the program and run it, I get the invalid syntax error. If I go to "Open with" and choose IDLE from the program folder, I get an error - this app will not run on this computer.
I guess that the Win10 update version 1909 has done something serious to the system, since it isn't reporting correctly to the Python website, nor is it able to run Python/IDLE. So far, no other program appears to be failing, but it is early days yet.
Any ideas welcome.
Thank you

Interface is messed up after installing several plugins | Signal only works in main thread - Spyder report

I'm trying to install several plug-ins in Spyder IDE, such as:
unit test
notebook
line profiler
spyder-terminal
memory-profiler
spyder-report
But unfortunately, I've got some serious problem. The installation was good, though I couldn't install spyder-vim and conda-manager plug-in for some unknown reason.
But the thing was horrible after launching the IDE. It's just broken somehow and not responding. Mouse unclickable. The interface was totally messed up.
After removal of these plug-ins, I again manually installed those plug-ins and tried to figure it out which plug-in caused this.
This time I only installed
unit test spyder-report notebook terminal
and now after launching, I saw interface was a little bit finer than before and discovered some problem in the spyder-report plug-in. While rendering report to HTML it showed the following error:
signal only works in main thread
I'm not sure whether I'll try other plug-in, but everything is pretty OK now except the spyder-report plug-in. I googled it for a day, but I found no effective solution.
You didn't say which version of Spyder and Python you installed, nor which operating system you are using. So, using Debian unstable and Python 3.6.5, I installed:
spyder3, 3.2.6
spyder-common, 3.2.6
python3-spyder, 3.2.6
python3-spyder-memory-profiler, 0.1.2
python3-spyder-line-profiler, 0.1.1
python3-spyder-reports, 0.1.1
python3-spyder-unittest, 0.3.0
as well as all of their dependencies. After that, I started spyder3 without any problems (except that I have to use the Spyder 2 icon theme, because it can't find the Spyder 3 icons). The Reports tab works fine, no "Signal only..." error.
The problem with spyder-vim seems to be that no actual release has been made yet, so pip3 install spyder-vim doesn't find anything.
Last, I added the terminal plugin with pip3 install spyder-terminal.
Again, after that all is working fine.

How to properly configure the new Anaconda 2.1 in PyCharm 3.4?

I recently updated to Anaconda to 2.1. For some reason, Pycharm 3.4 was previously configured with E.Canopy - Python 2.7.6. I did not know that, so yesterday I uninstalled Canopy. Now when I open PyCharm I get:
Invalid Python interpreter selected for the project
So I followed the instructions to configure the appropriate interpreter: Anaconda. However the configuration fails. I get:
11:44:38 AM Some skeletons failed to generate: 1 module failed in 1 interpreter. Details...
Failed Modules
**Python 2.7.7**
dde
Generation of skeletons for the modules above will be tried again when modules are updated or a
new version of generator is available
So it seems there's a conflict because of the different Python Versions....How can I solve this?
Thanks
That happend to me... I just repeated the update process. hope this helps.

How can I update Python on Mac OS and have RubyGems use the new version?

I am having serious issues trying to download the "therubyracer" gem. I think the problem is that I do not have a working libv8 library to create the gem.
I think I do not have a working libv8 because my RubyGems keeps trying to use "Python 2.5.6", which is too old to gem install libv8. I tried countless ways to update the Python that RubyGems uses, however, I cannot figure it out.
Here is what I have done thus far. I went to http://www.python.org/download/releases/3.3.2/ and downloaded "(Mac OS X 64-bit/32-bit Installer (3.3.2) for Mac OS X 10.6 and later 2.)".
Upon completion of the download, I ran:
gem install libv8 --version 3.11.8.17
Yet, I still received the same error. I noticed the output still said:
"Using Python 2.5.4"
Despite downloading a newer Python version, it is not being used. So how do I change the version of Python that the "gem" command uses? I searched and discovered "virtualenv," which appears to be a good Python manager, however I am a bit at a dead end now. Any help or suggestion?
If libv8 uses the python command from the command line, this should apply:
If you do not care what python2 is installed, you can do this in the command line:
type python # this gives you the path of the python command
python is /usr/bin/python
type python2.7
python is /usr/bin/python2.7
Then you can copy one over the other
cp /usr/bin/python2.7 /usr/bin/python
You can safely copy python2.7 there because it is compatible with older versions.
Suggestions?

No module named psycopg2

I have Django project which uses postgresql 9. I installed psycopg2 and when I run project I receive 'Error loading psycopg2 module: dll load failed'. I met this issue for the first time. I have windows 7 x64 with python2.7. How can I solve this one?
I had the same problem, it was that psycopg2 does not install well in Windows with _easy_install_, I followed the instructions on the follow SO answer:
Installing psycopg2 (postgresql) in virtualenv on windows
You need to manually install the psycopg2 exe file:
psycopg2-2.4.2.win-amd64-py2.7-pg9.0.4-release.exe
I know this is going to haunt me again or as nwcell puts it:
Every time I need to set up psycopg2 on windows, I wind up wanting to shoot something.
I actually have a machine with it working and I've been at pains to setup another machine. I installed Python 3.8 and the old PC has 3.7.4. The main difference was the file:
C:\project\venv\Lib\site-packages\psycopg2_psycopg.cp37-win32.pyd
On the new PC it was showing as AMD64. I eventually uninstalled 3.8 and reverted back to 3.7.4, then I copied the files from the old PC to the new and then I hit this error:
https://stackoverflow.com/a/37819509/495455
Going to a WayBackMachine version of the stickpeople:
https://web.archive.org/web/20191003103502/http://www.stickpeople.com/projects/python/win-psycopg/
I didn't install the exe, I simply did a pip install -Iv psycopg2-binary==2.8.4 at which point it started working. So I'm thinking the latest version doesn't work, for me 2.8.4 still works: https://pypi.org/project/psycopg2/#files
It's something to do with x64 as everything I tried with AMD64 didn't work and I spent ages on it.

Categories