View Single Post
Old 10-19-2009, 03:33 PM   #47
edembowski
Zealot
edembowski has a complete set of Star Wars action figures.edembowski has a complete set of Star Wars action figures.edembowski has a complete set of Star Wars action figures.edembowski has a complete set of Star Wars action figures.
 
edembowski's Avatar
 
Posts: 138
Karma: 372
Join Date: Apr 2008
Location: New York, NY
Device: Sony PRS-600, Nook Color, iPad
Quote:
Originally Posted by epstewart View Post
I would like to get someone's expert help on this. I'm trying to use the ineptepub.py script on my Mac running Leopard 10.5.8, and I have no clue what I'm doing when it comes to Python and Crypto.
pthwaite and adullday are right, you probably had Python installed already, and this confused things.


Quote:
I obtained the Python 2.6.2 for the Mac package (it seems to be called MacPython) and installed it by double clicking its .mpkg installer, resulting in a Python 2.6 folder in my Applications folder. This folder has a Python Launcher app, an IDLE app, a Build Applet app, an Update Shell Profile command file, and a folder of Extras. I am not sure if the actual Python interpreter is in there???
I just got Python from python.org (it's 2.6.3). Yes, the interpreter is there. Here's a sample of what happens after installation:

Code:
lizard:build ed$ which python
/usr/bin/python
lizard:build ed$ which python2.5
/usr/bin/python2.5
lizard:build ed$ which python2.6
/usr/local/bin/python2.6
lizard:build ed$ ls -l /usr/bin/python
lrwxr-xr-x  1 root  wheel  72 Mar 11  2009 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.5/bin/python
lizard:build ed$
That's from a command prompt. What it's showing you is that python 2.5 and 2.6 are both installed. If you navigate to a python script in Finder and hit `get info`, you'll probably see that the default is to open with IDLE. That's Python's default development environment.

Quote:
...Huh? Does that mean to run those commands in Terminal?
Yes, exactly.

Quote:
In doing so, I figured I had to use the cd command in Terminal to change my current directory to the pycrypto-2.0.1 folder on my desktop. Then I entered python setup.py build and saw a raft of messages rolling by in my Terminal window. Though there were several "warning" messages, there didn't seem to be any errors. So I entered python setup.py install and got a handful of running ... messages, a lot of copying ... messages, and then:
running install_egg_info
Removing /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pycrypto-2.0.1-py2.6.egg-info
Writing /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/pycrypto-2.0.1-py2.6.egg-info
I gather that means Crypto installed properly???
Yes, and pay close attention to the output. It's telling you that it's installing to the 2.6 installation, not the 2.5 (we're OK so far)


Quote:
But now I try to run my ineptepub.py script -- it's on my desktop
...

I had to use Get Info in the Mac Finder to direct that double clicking on .py files should open Python Launcher rather than IDLE, which seems to be the Python development environment.
That's the default behavior for 2.6.

Quote:
After doing that, when I double click on ineptepub.py, I see an app called Python try to run the script but instead fail on an error message:
This script requires PyCrypto, which must be installed separately. Read the top-of-script comment for details.
I also saw a new window open up in Terminal, with the contents:
Last login: Mon Oct 19 12:23:16 on ttys002
[iMac:~] eric% cd '/Users/eric/Desktop/' && '/usr/local/bin/pythonw' '/Users/eric/Desktop/ineptepub.py' && echo Exit status: $? && exit 1

OK, so at this point I'm totally lost. I thought I installed PyCrypto, but now I'm being told I need to install PyCrypto.

Can someone please help me get this working? Thanks in advance ...
This is where I think your problem is. The laucher is probably pointing to 2.5, and you have pycrypto in your 2.6 install. Try running it from the command line and see what happens.

edit: from the command line, try running python2.6 not python.

- Ed

Last edited by edembowski; 10-19-2009 at 03:39 PM.
edembowski is offline   Reply With Quote