10-19-2009, 03:31 PM | #46 | |
Connoisseur
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
|
Quote:
I'll answer you further in the process of responding to adullday below. Thanks again. |
|
10-19-2009, 03:33 PM | #47 | ||||||
Zealot
Posts: 138
Karma: 372
Join Date: Apr 2008
Location: New York, NY
Device: Sony PRS-600, Nook Color, iPad
|
Quote:
Quote:
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$ Quote:
Quote:
Quote:
Quote:
edit: from the command line, try running python2.6 not python. - Ed Last edited by edembowski; 10-19-2009 at 03:39 PM. |
||||||
Advert | |
|
10-19-2009, 04:08 PM | #48 | |
Connoisseur
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
|
Quote:
/usr/bin/python /Users/eric/Desktop/ineptepub.py in Terminal I again got the error I mentioned in my first post. When I followed the advice I got from Howard in his post and ran /usr/bin/python /Users/eric/Desktop/pycrypto-2.0.1/test.py I gotTraceback (most recent call last): File "/Users/eric/Desktop/pycrypto-2.0.1/test.py", line 18, in <module> from Crypto.Util import test ImportError: No module named Crypto.Util It seems I have too many Pythons. I used defaults write com.apple.finder AppleShowAllFiles TRUE in Terminal to make all my files show up in Finder. Then I went into /usr/bin/ and found various items whose names begin with python. Most are aliases. The original of the python alias is killall Finder /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5 Meanwhile, I've been able to discover that Crypto installed itself as /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/Crypto So I'm somehow using Python 2.5 instead of 2.6, which is where Crypto is! I note that 2.5 is in the /System/Library/ hierarchy while 2.6 is in the /Library/ hierarchy. Can one of you experts tell me how to correct this? Many thanks in advance ... Eric |
|
10-20-2009, 07:13 AM | #49 | |
Zealot
Posts: 138
Karma: 372
Join Date: Apr 2008
Location: New York, NY
Device: Sony PRS-600, Nook Color, iPad
|
Quote:
run python2.6 instead of python and you'll have it! read my post above!! - Ed |
|
10-20-2009, 09:07 AM | #50 |
Fanatic
Posts: 597
Karma: 430
Join Date: Aug 2008
Location: Ellesmere Port, UK
Device: DR1000S Sony PRS505 iPad iPhone
|
Yes, as edembowski says, if you read his last 2 posts, I think it should work then.
cheers, H |
Advert | |
|
10-20-2009, 12:22 PM | #51 | |
Connoisseur
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
|
Quote:
Thanks, but I am not totally sure what you mean by running python2.6 from the command line. Could you give me the exact syntax I would need to run ineptepub.py from the command line using python2.6 instead of python? Because when I try [iMac:~] eric% python2.6 /Users/eric/Desktop/ineptepub.py from the command line, I still get my original error message: This script requires PyCrypto, which must be installed separately ... I can tell by inspecting the file usage of the Python process in Activity Monitor while the message is still being displayed that /Library/Frameworks/Python.framework/Versions/2.6/Resources/Python.app/Contents/MacOS/Python is being used, meaning I'm really using the 2.6 version I installed. Entering the where python2.6 command, I see [iMac:~] eric% where python2.6 /Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6/usr/local/bin/python2.6 To prove Crypto is installed for Python 2.6: [iMac:~] eric% ls -l /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages total 16 drwxr-xr-x 11 eric admin 374 Oct 13 16:02 Crypto -rw-rw-r-- 1 root admin 119 Oct 2 01:58 README -rw-r--r-- 1 eric admin 629 Oct 19 12:10 pycrypto-2.0.1-py2.6.egg-info I must be missing something in my understanding, but the best I can tell, my Python 2.6 has the PyCrypto package duly installed in its hierarchy, but still it is unable to find it and use it when I run the ineptepub.py script using python2.6 in Terminal. Furthermore, when I simply double click on ineptepub.py on my desktop, I get the same error message, Activity Monitor again shows that the Python 2.6 hierarchy is being invoked (not 2.5), and I see Last login: Tue Oct 20 11:27:32 on ttys001 cd '/Users/eric/Desktop/' && '/usr/local/bin/pythonw' '/Users/eric/Desktop/ineptepub.py' && echo Exit status: $? && exit 1 [iMac:~] eric% cd '/Users/eric/Desktop/' && '/usr/local/bin/pythonw' '/Users/eric/Desktop/ineptepub.py' && echo Exit status: $? && exit 1 appearing in a new Terminal window that opens in response to my double click, but there is no new prompt in that window. Python's icon magically appears in my Dock. When I click on it and then click OK in the Python error-message window, the withheld prompt reappears in the Terminal window that has just opened. Summarizing: I seem to have Python 2.6 properly installed, and PyCrypto duly installed within its folder hierarchy. When I invoke python2.6 /Users/eric/Desktop/ineptepub.py from the Terminal command line interface or when I double click the ineptepub.py icon on my Desktop, it is the 2.6 version of Python that starts up ... but that version is unable to satisfy the script's desire to use PyCrypto! Ed and all you other experts: do you have any further things for me to try? Thanks incredibly much in advance ... |
|
10-20-2009, 06:30 PM | #52 |
Fanatic
Posts: 597
Karma: 430
Join Date: Aug 2008
Location: Ellesmere Port, UK
Device: DR1000S Sony PRS505 iPad iPhone
|
It does look like your pycrypto install hasn't worked.
I'm afraid I have 10.6 and the structure is slightly different than 10.5, I have Computers Hard Drive, Library, Python, 2.6, site-packages, Crypto I did have a similar problem when I tried installing initially, I unzipped the pycrypto package but didn't use all the directories. eg: When I unzipped it I ended up with: pycrypto2.0.1, pycrypto2.0.1 and then the files. I then moved all the files up a level before trying to install pycrypto and it didn't work. Re-created the structure as it unzipped and re-ran the installer and it then worked. If you can't get the test file to run, it hasn't been installed correctly. Which isn't much help I'm afraid. Your: [iMac:~] eric% python2.6 /Users/eric/Desktop/ineptepub.py is correct in its usage (at least it works for me) but not having 10.5 I cannot remember what I used to have. |
10-21-2009, 12:08 PM | #53 |
Connoisseur
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
|
Ed, Howard, et al.:
I went back to square one and deleted /Library/Frameworks/Python.framework/Versions/2.6/ on my system and then reinstalled Python 2.6 and then PyCrypto from their respective downloaded installers ... and everything is working fine now! I can't be sure of this, but the problem could have had to do with my having renamed one copy of my installed pycrypto-2.0.1 folder, calling it Crypto. I did that because my examining the ineptepub.py script seemed to indicate that it wanted to find PyCrypto in a folder having the name Crypto. I was floundering around trying to see why the ineptepub.py script wasn't working originally, and thought I'd try that. But maybe it wasn't working for some other reason, which I managed to fix, but then it wouldn't work because I had renamed the folder. Before I did the re-installs, I deleted that folder, so the re-installs may have been superfluous. Anyway, thanks for all your help. Now that I'm up and running, I'd like to ask for some clarifications about how all this works. First, I note that the original post said to rename my .pyw files and change their extensions to .py. What was that for? What is the significance of the "w" which I had to strip away? Two, am I correct in saying that I can't run on a Mac the script that creates the adeptkey.der file, that it has to be run under Windows? Why is that? It would seem to be a major drawback, since a lot of Mac users don't have access to Windows. (I happen to be able to run Windows under Parallels Desktop, so I was able to get around this problem.) Three, in installing PyCrypto, the associated README file suggests there is a need to run python setup.py build and python setup.py install. I find (1) only the latter is needed; (2) after a successful install of Python 2.6, invoking python from the command line in Terminal in fact uses Python 2.6, which is good; (3) I had to include the full path to setup.py, i.e., /Users/eric/Desktop/INEPT/pycrypto-2.0.1/setup.py, by dragging the Finder icon of that file to the Terminal window. Does that square with your understanding? Also, I'd like to mention my reason for using ineptepub: I read eBooks on my iPhone in the Stanza app, and I'd like to be able to borrow eBooks from the Maryland Digital Consortium, which includes all of Maryland's public libraries. These eBooks come in ADEPT/EPUB format (also ADEPT/PDF, but I'm not interested in that) and accordingly can't be used in Stanza or any other reader app on the iPhone — unless the DRM is stripped off! Thanks again ... Eric |
10-21-2009, 03:36 PM | #54 |
Fanatic
Posts: 597
Karma: 430
Join Date: Aug 2008
Location: Ellesmere Port, UK
Device: DR1000S Sony PRS505 iPad iPhone
|
You can't run the script as it stands to get the adeptkey as it was written to extract it from windows and it is stored differently. See my PM
Howard Last edited by pthwaite; 10-21-2009 at 03:42 PM. |
10-22-2009, 04:47 PM | #55 | ||||||
Zealot
Posts: 138
Karma: 372
Join Date: Apr 2008
Location: New York, NY
Device: Sony PRS-600, Nook Color, iPad
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
- Ed |
||||||
10-23-2009, 10:22 AM | #56 | |||||
Connoisseur
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
|
Ed,
Thanks. Quote:
Quote:
Quote:
Quote:
Quote:
Thanks for all your help, Ed. Eric |
|||||
10-23-2009, 11:18 AM | #57 | |
.
Posts: 3,408
Karma: 5647231
Join Date: Oct 2008
Device: never enough
|
Quote:
|
|
10-23-2009, 11:57 AM | #58 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2009
Device: Sony PRS-600
|
I'm having a problem that I haven't seen mentioned yet. It's probably something on my end not set up right, but..
I've updated Python to 2.6 and installed PyCrypto, and all of that seems to be running fine. But whenever I run the ineptepub script, it goes fine until I press the decrypt button after choosing all of the appropriate files. When I press decrypt, it pops a message saying... Error: File name in directory " Exactly like that. I can't seem to figure out where my problem is on this. Any ideas? |
10-23-2009, 12:37 PM | #59 |
Quilt Geek
Posts: 472
Karma: 91775
Join Date: Aug 2007
Location: Lancaster, PA
Device: Kindle
|
Wow, I came here to post that exact problem. I can decrypt in my Windows VM. I've verified the .der file is the same whether created on Windows or Mac. I've re-downloaded the files on the Mac (instead of copying from the VM). But nothing works. If I use the epub file that I downloaded in the VM and the .der file I created on the Mac, but do the decrypt on the Mac, it works, but that kind of defeats the purpose in getting this running on the Mac. I'm running python 2.6.1 on Mac OSX 10.6.1.
It seems that files that are downloaded on the Mac never work for me, only the files downloaded from Windows. Looking at the files in a hex editor (one epub downloaded in the VM, one downloaded on the Mac), they differ near the very end and that's where the problem lies. ADE on the Mac will read the file, but the decrypt fails. Suggestions? |
10-23-2009, 12:59 PM | #60 |
Enthusiast
Posts: 35
Karma: 483720
Join Date: Aug 2009
Device: none
|
This may or may not be your problem, but I've run into similar issues with several epubs. Since I usually download my files on my Mac, I don't know whether or not this is an issue particular to the files distributed to the Mac. But what the heck... try this and see if it works....
It appears that there is an issue related to the zlib library, although it may be a problem in the zip file itself since the built-in de-zippifier on Windows seems to have the same issue. If you unzip the epub (which you may know is a zip file with the epub extension) with the MacOS built-in and re-zip it should (hopefully) work fine. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
If a pdf won't epub, try this (on a Mac) | Paulc15 | Kobo Reader | 6 | 05-09-2010 10:16 PM |
Sony ereader & Mac OSX | brockman | Introduce Yourself | 10 | 07-24-2009 03:37 PM |
How to use iLiad with Mac OsX? | jasem200 | iRex | 6 | 08-17-2008 10:48 AM |
Help with HandStory & Mac OSX! | daught | Reading and Management | 7 | 01-22-2004 12:44 PM |
Mac OSX vs Windows XP | Alexander Turcic | Lounge | 5 | 06-05-2003 01:30 PM |