[Pythonmac-SIG] Re: Running the pyPgSQL postgresql driver?

Marlon A. Griffith marlong at rogers.com
Mon Dec 15 15:34:11 EST 2003


Thanks Russell,
	That was the problem. I was not using MacPython at the 
command line but getting Apple's python, which didn't have the driver 
installed for it. Since I have a command line and gui access to 
MacPython now, I don't really need Apple's python. I am set to go.
	The weird thing is that I can import the driver into 
MacPython but the command to run the test cases still doesn't work. I 
get a password error. I suspect that this is a problem with the 
privileges on PostgreSql not MacPython. Ahh, lots of things to learn!

Thanks again for your suggestions.

At 9:57 AM -0800 12/15/03, Russell E. Owen wrote:
>In article <a06002000bbff069f0bf2@[192.168.1.100]>,
>  "Marlon A. Griffith" <marlong at rogers.com> wrote:
>
>>  I have managed to install pyPgSQL on my mac:
>>  - X.2.8
>>  - postgresql 7.3
>>  - MacPython 2.3, the July 30th 2003 release...
>>  through the instructions at
>>  http://pypgsql.sourceforge.net/README.html and the modifications
>>  noted in an earlier post. I was running the testcases when I got this
>>  message:
>>  """
>>  [Kalyxsis-Sways-Computer:~] postgres% python
>>  /Volumes/scratch/jython/pypgsql/test/PgSQLTestCases.py
>>  Traceback (most recent call last):
>>     File "/Volumes/scratch/jython/pypgsql/test/PgSQLTestCases.py", line
>>  89, in ?    from pyPgSQL import PgSQL
>>  ImportError: No module named pyPgSQL
>>  """
>>
>>  I tried to import the module using Apple's python and MacPython.
>>  MacPython worked and Apple's didn't. I got this error in Apple's
>>  python:..
>
>The basic problems (I think) is that when you type "python setup.py" at
>the command line, you are telling setup.py WHICH python gets the module.
>If you want to install on more than one python, follow the installation
>instructions using each version of Python in turn.
>
>But do you really want two versions of python? MacPython 2.3 includes a
>command-line python installed in /usr/local/bin (this is a link to a
>file in the framework python 2.3). If you used that, then you could
>install packages once and have them available both from MacPython and
>command line python!
>
>One way to get python 2.3 as your command-line python is to put
>/usr/local/bin before /usr/bin in your PATH. One way to do this is
>create or edit a text file ~/.cshrc (preferably with unix line endings)
>to include:
>setenv PATH "/usr/local/bin:/Library/Tcl/bin:"$PATH
>
>I'm not sure this is the full answer. I somewhat suspect you already
>know what I wrote if you managed to install the package in MacPython 2.3
>framework instead of Apple's built in python. In any case, I *hope* this
>helps.
>
>-- Russell
>
>P.S. if you plan to do any GUI programming and want to set your
>PYTHONPATH, you'll want to set it in ./MacOSX/environment.plist rather
>than in .cshrc. One set of instructions is my page
><http://www.astro.washington.edu/owen/AquaEnvVar.html>. I hope the info
>is also in the MacPython documentation but I haven't looked recently.

-- 

Make it a great day!
http://members.rogers.com/kalyxsis


"We move ahead by going deeper." Jennifer James (1943- ) American Writer

"Don't let your schooling interfere with your education."  Mark Twain
"Do not parrot the words of famous people. Learn the meaning of what they
say and repeat it in your own words."  Mark Twain (not an exact quote).



More information about the Pythonmac-SIG mailing list