Python 3.0 - Idle wont open. It just bounces in the dock - python

Python/Unix noob. On Mac OSX.
Been running Python 2.7.2 for a few weeks, along with Idle app. No problems.
Today I just installed Python3.0 along side 2.7 - tested both and can still be ran via Terminal.
Now when I open Idle for 2.7, it opens just fine. But when I open the new Idle app within the Python3.0 folder, the app just bounces in the doc and never opens.
The error from Console is as follows:
12/2/11 11:57:13.612 PM com.apple.launchd.peruser.501:
([0x0-0x38038].org.python.IDLE[313])
posix_spawn("/Applications/Python-3.0/Mac/IDLE/IDLE.app/Contents/MacOS/IDLE", ...):
No such file or directory
How do I get Idle to open for Python3.0?

Do not use Python 3.0. The initial releases of Python 3 were somewhat experimental and had a number of serious problems that have been fixed in subsequent releases. The fixed problems include the one you're seeing which I believe was covered by Issue5196. The current release of Python 3 is 3.2.2 and is considered production-ready. You can find installers for Mac OS X here. There are two installers depending on which version of OS X you are running. If on OS X 10.6 (Snow Leopard) or 10.7 (Lion), pay particular attention to the cautions here about also installing the current version of ActiveState Tcl/Tk to be used instead of the buggy Tcl/Tk 8.5 shipped by Apple in those systems.

Related

Cannot get python IDLE 2.7, 3.3 to run - OS X

I am running a MacBook Pro with 8gb of memory and a 2.5GHz processor. I run OS X Mavericks, but this problem has happened on other operating systems as well. when I try to open the editor, or even open a python file, this happens:
This has been a problem since I got into python. I have tried as many versions as I can, and the same screen pops up. Please help
I recently also upgraded a friends iMac to OS X 10.9 Mavericks and her Python to 2.7.6. If you mount the python-2.7.6-macosx10.6.dmg disk image there's a text file named ReadMe.txt. If you ahem, actually read it, right near the beginning it says:
**** IMPORTANT ****
Update your version of Tcl/Tk to use IDLE or other Tk applications
To use IDLE or other programs that use the Tkinter graphical user
interface toolkit, you may need to install a newer third-party version
of the Tcl/Tk frameworks. Visit
http://www.python.org/download/mac/tcltk/ for current information
about supported and recommended versions of Tcl/Tk for this version of
Python and of Mac OS X.
Here's what http://www.python.org/download/mac/tcltk currently looks like (my highlighting):
To summarize: You need to download and install ActiveTcl 8.5.15.1 (which is mislabeled ActiveTcl 8.5.15.0) from ActiveState's webpage. After doing that you should be able to run IDLE:
I haven't actually tried to do it yet, but from what I read it sounds like the same process applies to Python 3.3.3 and its IDLE app.
I was having the exact same problem.
I was finally able to install Python (and IDLE) via MacPorts by also installing a package called "pyXX-tkinter" -- where XX is the version, e.g. py34-tkinter for Python 3.4.

installing IPython with two versions of Python (Windows)

Is it possible to have IPython (0.12) installed on the same
system with two different versions of Python (v 2.7 and 3.2)? Currently I have both versions of Python running happily on my system.
I am using two machines, one with Windows 7 64-bit, the other XP SP2 32-bit, and both have Python 2.7.2 and 3.2 installed. I have been using IPython with Python 2.7 w/o any problems for a while on both.
Now I would like to have 3.2 available too with IPython, but when I try to run the binary windows IPython installer I get this error toward the end of the install:
*** run_installscript: internal error 0xFFFFFFFF ***
and no shortcuts/entries into Start Menu etc are created.
(I ran the install as adminstrator under Win 7) I am running into the same problem with XP and Win 7.
After poking around the net and SO for a while I saw references for
getting setuptools. Unfortunately, there's no version for Python 3.x
but it was suggested to use distribute.py instead which I ran and
installed. I am not sure how to proceed next. And I'm not even sure it
is possible to do this (though I think it is :)
Any suggestions?
UPDATE: There was a problem with import readline not working with Python 3.2.3, but I was able to fix it by downloading pyreadline-2.0-dev1.win32.exe which works with Python 3.2.3 .. the above problem remains unfortunately.
Ok, here's my solution to get IPython 0.12.1 to work with both Python ver
2.7.x and 3.2.x on the same system (ie. under Windows 7 64 bit and XP SP2 32 bit). It's not
perfect, but works, and hopefully will help others. Where I am showing directories they refer to XP (but should be adjusted accordingly for Windows 7)
Steps for both:
Install both versions of Python via the binary windows installer provided at
Python.org
Install this version of pyreadline pyreadline-2.0-dev1.win32.exe which works
for both versions of Python (I could not get the widely available version 1.7 to work with Python 3.2.x)
I am not sure if distribute.py is necessary, I'd skip it on the
first try.
Download ipython-0.12.1.zip file and extract it. Place it under your Programs directory and cd into it (I'll call this the ipython_dir) [I tried the binary installer numerous times without success]
For Python 3.2 (easier)
In the ipython_dir:
c:\python32\pyton.exe setup.py install
will create ipython3.exe in c:\python32\Scripts that can be used to
fire up iPython
For Python 2.7 (a bit odd)
The above method failed. However, it is possible to start IPython from the ipython_dir with
c:\python27\python.exe ipython.py
I can't explain why this is so, but since I use Console2 I can hide
these two ways of starting IPython.
Summary:
To start IPython with v 2.7.x of Python:
c:\python27\python.exe "C:\Program Files..\ipython_dir\ipython.py"
To start IPython with v 3.2.x of Python:
c:\python32\Scripts\python3.exe
That was a lot of work and took most of the day, so I hope posting the steps above
will save someone else a lot of time (and help me remember what I have to do next time I struggle with this)
Thanks everyone for their suggestions.
Addendum: None of the above resulted in shortcuts or entries in the Start/Program Menus. Shortcuts can be created manually, or in my case aren't necessary since I'm using a special shell (Console2) to run IPython.
The first question in the iPython FAQ titled "Running IPython against multiple versions of Python" may help.

IDLE crash when opening on Mac OS X

I recently attempted to install python 3.2 along with IDLE 3 on my macbook pro. I successfully installed python 3.2 (as in, I can run it from the terminal), but when I attempted to install IDLE 3.2 I must have done something wrong because now both IDLE 2.7 and IDLE 3.2 crash immediately upon opening with the message "Python quit unexpectedly", no matter whether I open it through the terminal or through finder. Does anyone know how to fix this? I have installed the correct ActiveTCL package (and reinstalled) and still nothing. I have attempted to reinstall python 3.2 and IDLE 3 but I am not sure whether I did it correctly. Through a good amount of googling I found some people say that it was most likely a path issue but all of the solutions I found were using Windows so I am not sure how to apply that to my mac.
Try renaming or removing the directory ~/.idlerc which is about the only thing used by Python that would in common to IDLE for 2.7 and 3.2. If that doesn't help, state exactly which Python 3 you installed, what version of OS X, and show the stack traces from the termination report.
UPDATE: Based on the crash report you've supplied, it appears that Tk is crashing during its initialization of menu items:
...
4 Tcl 0x00000001013dfa61 Tcl_Panic + 162
5 Tk 0x000000010151c523 TkpGetColor + 383
6 Tk 0x0000000101529a25 TkpMenuInit + 156
7 Tk 0x00000001014ac254 TkMenuInit + 88
8 Tk 0x000000010152c687 -[TKApplication(TKMenus) _setupMenus] + 53
...
I have not seen any reports of a similar problems when IDLE is used with A/S Tcl/Tk 8.5 on 10.7.3 and I haven't been able to reproduce it myself on 10.7.3. However, the Cocoa Tcl/Tk 8.5 is not the most robust framework out there and it may be susceptible to problems when using languages or input methods other than US or US Extended. Another possibility (more likely) is if you are using some third-party menu enhancement application or preference panel (to add colors to menus perhaps). If those suggestions don't help you to isolate the problem, I suggest you ask on the Tcl Mac mailing list (tcl-mac#lists.sourceforge.net, archived at http://dir.gmane.org/gmane.comp.lang.tcl.mac).
If you are running Mac OS X Lion, it sounds like you are being bitten by the saved-state crash. You need to delete the saved state to make the crash go away:
http://osxdaily.com/2011/07/17/delete-specific-application-saved-states-from-mac-os-x-10-7-lion-resume/
http://reviews.cnet.com/8301-13727_7-20083707-263/managing-mac-os-x-lions-application-resume-feature/
I had the same issue. I run OSX 10.8.5, Python 3.3.3 and IDLE 3.3.3 and reinstalling Python haven't been a solution.
I solved any problem removing the ~/.idlerc directory. My problem showed for the first time when I tried to change some Preferences (IDLE->Preferences->General->Startup Preferences->At Startup Open Edit Window), so I suppose that's why resetting my Preferences deleting ~/.idlerc folder have been the solution.
I had the same problem where IDLE would crash after I opened it on my MAC
I ended up updating my computer to OS Yosemite.
and the most updated version of python but it still would shut
the reason it started was because I tried to change the preferences for certain keys.
Resetting the preferences fixed it!
I typed mc ~/.idlerc idlerc2
:)
[Solved] I had the same problem here using:
Yosemite 10.10.2
python 3.4.2
The issue was solved downloading and installing the ActiveTcl 8.5.17.0 version from http://www.activestate.com/activetcl/downloads
Best Regards,
TchĂȘ

Bouncing Python Application in Mac Dock when Accessing URLs with py-appscript

This has been a recurring, strange issue for me when accessing URLs using py-appscript, first in Safari and now in Chrome.
Whenever I run the script command to get the current URL in the terminal, for example,
appscript.app("Google Chrome").windows.active_tab.URL()
a bouncing instance of the "Python" application appears in the Dock. I have verified that this "Python" application is found in:
/Library/Frameworks/Python.framework/Versions/2.6/Resources
How do I get the current URL without this thing popping up?
The background on this problem is explained here by the author of appscript. Assuming you are on OS X 10.5 or higher, the solution is to use a Python that has been built using a minimum deployment target of 10.5 or higher. From the path you supplied, it appears likely you are using a Python 2.6 from a python.org installer. Traditionally, python.org Pythons are built to run on multiple versions from 10.3 on up and so appscript running under it will show this problem. Starting with Python 2.7 (and additionally soon with Python 3.2), python.org is providing a second installer variant, one that only runs on OS X 10.6 or higher. Those variants should not have the bouncing icon problem. Other options are to install a Python 2.6 using MacPorts, Fink, or HomeBrew or build it yourself (a little tricky to get all the batteries included). Or, if you are on OS X 10.6, you can use the Python 2.6 supplied by Apple in /usr/bin.

Netbeans not allowing Python 2.6 as default platform (forcing Jython2.5)

I am trying to get Netbeans python to run with the default python platform set to Python 2.6.1 (my system python), so in Netbeans I do the following:
Tools -> Python Platform
Set Python 2.6.1 to 'default'
However, it seems impossible to make this stick. Whenever I restart Netbeans it's back to Jython 2.5 again.
Moreover, I can obviously autodetect and find Python 2.6.1, but whenever I make it "Default", Netbeans still runs with Jython 2.5 in that very session. (I know this because when I import sys and do a sys.path it only has Jython library dirs). And when I remove Jython I get the error:
"Selected project has broken python platform : default => bind to an existing python platform in project's properties".
I have tried this is 6.5 and 6.7. And I still get the same behavior. Furthermore, I know my system python works because I can use the python interpreter.
Looks like http://netbeans.org/bugzilla/show_bug.cgi?id=180693 which provides a clumsy and non persistent workaround.
This needs heavy complaining on the netbean bug tracker imo.
Might be worth logging a bug with Netbeans about the first bit of behaviour you described - I can confirm similar (although strangely not identical) symptoms on my system.
I tried this with Python 2.6.2 / Netbeans 6.5.1
NetBeans IDE 6.5.1 (Build 200903060201)
Java: 1.6.0_01; Java HotSpot(TM) Client VM 1.6.0_01-b06
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)
And my default Python platform also doesn't seem to stick: I restart and the default is back to "Jython 2.5b0+"
However, when I create a new Python project: the drop-down on the wizard is correctly set to 'Python 2.6.2": furthermore, when I created a new module like this:
import sys
print(sys.path)
It reports back correctly:
...'d:\\python26\\DLLs', 'd:\\python26\\lib'...
Maybe this is due to something about the slightly different Python platform versions - dunno?

Categories

Resources