Thread: [Pyobjc-dev] OK, I'm already stymied.
Brought to you by:
ronaldoussoren
From: Gary R. <gro...@tr...> - 2003-05-06 03:05:29
|
In the PyObjC tutorial, it says: > 1. Create a work directory src. Check which Python you have installed PyObjC > for, by running python and checking that import PyObjC works. If it does not > work it could be that you have installed PyObjC for /usr/local/python but > Apple's /usr/bin/python comes first in your $PATH. Make sure you use the right > python whereever it says python in this tutorial. I have run the PyObjC 0.9 installer. I have both 2.3 and Apple's 2.2 installed. Whether I am running python 2.2 or 2.3, the statement import PyObjC fails with ImportError: No module named PyObjC In python 2.2, I have >>> sys.path ['', '/usr/lib/python2.2', '/usr/lib/python2.2/plat-darwin', '/usr/lib/python2.2/lib-tk', '/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages', '/usr/lib/python2.2/site-packages/PyObjC'] And, after installing PyObjC I do have /usr/lib/python2.2/site-packages/PyObjC on my disk. So I'm mystified about why python 2.2 can't import PyObjC. I want to use PyObjC with Apple's 2.2 python distribution. Any insights would be most appreciated. --Gary -- [http://ThisURLEnablesEmailToGetThroughOverzealousSpamFilters.org] Gary Robinson CEO Transpose, LLC gro...@tr... 207-942-3463 http://www.transpose.com http://radio.weblogs.com/0101454 |
From: <bb...@ma...> - 2003-05-06 04:44:12
|
On Monday, May 5, 2003, at 20:05 US/Pacific, Gary Robinson wrote: > Whether I am running python 2.2 or 2.3, the statement > > import PyObjC > > fails with > > ImportError: No module named PyObjC There isn't a PyObjC Module -- it is flattened up into the regular import space by a magic file in site-packages. Try: [bumbox:~/bbum-developer/sourceforge/pyobjc] bbum% /usr/bin/python Python 2.2 (#1, 07/14/02, 23:25:09) [GCC Apple cpp-precomp 6.14] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import Foundation >>> |
From: Ronald O. <ous...@ci...> - 2003-05-06 04:49:32
|
On Tuesday, May 6, 2003, at 05:05 Europe/Amsterdam, Gary Robinson wrote: > In the PyObjC tutorial, it says: > >> 1. Create a work directory src. Check which Python you have installed >> PyObjC >> for, by running python and checking that import PyObjC works. If it >> does not >> work it could be that you have installed PyObjC for /usr/local/python >> but >> Apple's /usr/bin/python comes first in your $PATH. Make sure you use >> the right >> python whereever it says python in this tutorial. > > I have run the PyObjC 0.9 installer. > > I have both 2.3 and Apple's 2.2 installed. > > Whether I am running python 2.2 or 2.3, the statement > > import PyObjC > > fails with > > ImportError: No module named PyObjC That's right, PyObjC is only the name of the project not of packages we install :-). I'd start by browsing some of the example code (for example our tuturial). Use 'import Foundation' to access the Foundation classes (and functions/constants in that framework). BTW. The installer only installs our packages for Apple's Python 2.2. To use PyObjC with Python 2.3b1 you have to install using the PackageManager (or just from source, the usual 'sudo python setup.py install' will do). Ronald |
From: Gary R. <gro...@tr...> - 2003-05-06 10:34:52
|
OK, Ronald and bbum, thanks for the quick responses. I was able to successfully import Foundation so I guess my installation is OK after all. But I suggest updating the Tutorial (Documentation/PyObjC/tutorial/tutorial.html) so that it urges the user to "import Foundation" rather than "import PyObjC" since the latter won't work. I lost over an hour to that, and I'm on a race here to see how much I can accomplish with PyObjC over the next few days -- that will determine whether we use it for the project where considering! But, your quick responses once I asked the question made a big difference. Thanks again. Onward and upward! --Gary -- [http://ThisURLEnablesEmailToGetThroughOverzealousSpamFilters.org] Gary Robinson CEO Transpose, LLC gro...@tr... 207-942-3463 http://www.transpose.com http://radio.weblogs.com/0101454 > From: Ronald Oussoren <ous...@ci...> > Date: Tue, 6 May 2003 06:48:26 +0200 > To: Gary Robinson <gro...@tr...> > Cc: <pyo...@li...> > Subject: Re: [Pyobjc-dev] OK, I'm already stymied. > > > On Tuesday, May 6, 2003, at 05:05 Europe/Amsterdam, Gary Robinson wrote: > >> In the PyObjC tutorial, it says: >> >>> 1. Create a work directory src. Check which Python you have installed >>> PyObjC >>> for, by running python and checking that import PyObjC works. If it >>> does not >>> work it could be that you have installed PyObjC for /usr/local/python >>> but >>> Apple's /usr/bin/python comes first in your $PATH. Make sure you use >>> the right >>> python whereever it says python in this tutorial. >> >> I have run the PyObjC 0.9 installer. >> >> I have both 2.3 and Apple's 2.2 installed. >> >> Whether I am running python 2.2 or 2.3, the statement >> >> import PyObjC >> >> fails with >> >> ImportError: No module named PyObjC > > > That's right, PyObjC is only the name of the project not of packages we > install :-). I'd start by browsing some of the example code (for > example our tuturial). Use 'import Foundation' to access the Foundation > classes (and functions/constants in that framework). > > BTW. The installer only installs our packages for Apple's Python 2.2. > To use PyObjC with Python 2.3b1 you have to install using the > PackageManager (or just from source, the usual 'sudo python setup.py > install' will do). > > Ronald > |
From: Zachery B. <zb...@ur...> - 2003-05-06 11:01:56
|
On Tuesday, May 6, 2003, at 06:34 AM, Gary Robinson wrote: > OK, Ronald and bbum, thanks for the quick responses. > > I was able to successfully > > import Foundation > > so I guess my installation is OK after all. > > But I suggest updating the Tutorial > (Documentation/PyObjC/tutorial/tutorial.html) so that it urges the > user to > "import Foundation" rather than "import PyObjC" since the latter won't > work. I agree. Caught me at first, as well. Zac |
From: Just v. R. <ju...@le...> - 2003-05-06 11:29:37
|
Things to do for 0.9.1 ;-) I also noticed the tutorial begins rather complicated with setting an environment variable. This should not needed for nibclassbuilder, as it's installed as a command line tool. Perhaps we should also install bundlebuilder as a command line tool? Hm, and then there's the problem that /usr/local/bin isn't on the path by default, which is where nibclassbuilder bets installed, even for a python2.2 install. Just |
From: tmk <li...@ne...> - 2003-05-06 12:32:00
|
Got bitten too. But some digging and remembering flattening discussion put me back to track. I'm also going through the docs and taking note of what may need to be corrected. I'll post back my notes as a whole once I'm finished (hopefully sometimes this week). Btw, I keep forgetting but HUGE kudos to whole the team for bringing us 0.9 so far it looks incredibly cool. = tmk = On Tuesday, May 6, 2003, at 13:01 Europe/Brussels, Zachery Bir wrote: > On Tuesday, May 6, 2003, at 06:34 AM, Gary Robinson wrote: > >> OK, Ronald and bbum, thanks for the quick responses. >> >> I was able to successfully >> >> import Foundation >> >> so I guess my installation is OK after all. >> >> But I suggest updating the Tutorial >> (Documentation/PyObjC/tutorial/tutorial.html) so that it urges the >> user to >> "import Foundation" rather than "import PyObjC" since the latter >> won't work. > > I agree. Caught me at first, as well. > > Zac > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > |
From: Michael H. <mw...@py...> - 2003-05-06 12:43:28
|
Zachery Bir <zb...@ur...> writes: > On Tuesday, May 6, 2003, at 06:34 AM, Gary Robinson wrote: > >> OK, Ronald and bbum, thanks for the quick responses. >> >> I was able to successfully >> >> import Foundation >> >> so I guess my installation is OK after all. >> >> But I suggest updating the Tutorial >> (Documentation/PyObjC/tutorial/tutorial.html) so that it urges the >> user to >> "import Foundation" rather than "import PyObjC" since the latter >> won't work. > > I agree. Caught me at first, as well. OK, another question: why is it done like this? Cheers, M. -- Ya, ya, ya, except ... if I were built out of KSR chips, I'd be running at 25 or 50 MHz, and would be wrong about ALMOST EVERYTHING almost ALL THE TIME just due to being a computer! -- Tim Peters, 30 Apr 97 |
From: Dinu G. <gh...@da...> - 2003-05-06 12:59:00
|
Michael Hudson: > OK, another question: why is it done like this? Excellent question! In fact, I was wondering why the many Mac modules on http://www.python.org/doc/current/modindex.html don't live under one common shelter, say a package named "mac", too? Wouldn't that help fighting "namespace pollution" disease? Or is it "too late"? Dinu -- Dinu C. Gherman ...................................................................... "The West won the world not by the superiority of its ideas or values or religion but rather by its superiority in applying organized vio- lence. Westerners often forget this fact, non-Westerners never do." (Samuel P. Huntington) |
From: Jack J. <Jac...@cw...> - 2003-05-06 13:36:44
|
On Tuesday, May 6, 2003, at 14:43 Europe/Amsterdam, Michael Hudson wrote: >>> But I suggest updating the Tutorial >>> (Documentation/PyObjC/tutorial/tutorial.html) so that it urges the >>> user to >>> "import Foundation" rather than "import PyObjC" since the latter >>> won't work. >> >> I agree. Caught me at first, as well. > > OK, another question: why is it done like this? When I wrote the tutorial you still needed to do "import PyObjC". Then the PyObjC package finally disappeared, to make the names more compatible with Apple documentation (something that was on the todo list for a long time). Then nobody remembered to fix the tutorial:-( -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |
From: Just v. R. <ju...@le...> - 2003-05-06 14:09:01
|
Jack Jansen wrote: > When I wrote the tutorial you still needed to do "import PyObjC". > Then the PyObjC package finally disappeared, to make the names more > compatible with Apple documentation (something that was on the todo > list for a long time). Then nobody remembered to fix the tutorial:-( Hm, there's the objc module, which used to be called pyobjc, but that happened long before I first worked with PyObjC and surely predates your tutorial. There's a new module called PyObjCTools, but in recent times there has been no module called PyObjC, so I have my doubts "import PyObjC" ever worked during the existence of the tutorial... Just |
From: Jack J. <Jac...@cw...> - 2003-05-07 10:50:54
|
On Tuesday, May 6, 2003, at 16:05 Europe/Amsterdam, Just van Rossum wrote: > Jack Jansen wrote: > >> When I wrote the tutorial you still needed to do "import PyObjC". >> Then the PyObjC package finally disappeared, to make the names more >> compatible with Apple documentation (something that was on the todo >> list for a long time). Then nobody remembered to fix the tutorial:-( > > Hm, there's the objc module, which used to be called pyobjc, but that > happened long before I first worked with PyObjC and surely predates > your > tutorial. There's a new module called PyObjCTools, but in recent times > there has been no module called PyObjC, so I have my doubts "import > PyObjC" ever worked during the existence of the tutorial... ... Hmm... I'm pretty sure that I started with a clean environment when I wrote the tutorial, but maybe I goofed up somehow? -- Jack Jansen, <Jac...@cw...>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman |