I have the pgdb module installed on my MacOsX development box, my code works (specifically a line that is pgdb.connect(etc..) works great. I runt his code on my main server (linux) and it it says module has no attribute connect.
I think it is a version issue so I do what is suggested here to view the versions:
How to check version of python modules?
That is I do:
python
import pgdb
print pgdb.__version__
On my macosX box, returns the version just fine on my development machine it gives the error again:
AttributeError: 'module' object has no attribute '_version_'
Strange thing is, doing an import pgdb does not throw an error but it acts like it is not installed on my production box. Perhaps it is a library mangling on the box I am not aware of? I should say import pgdb as myspecialsomething (That didn't do it still says no connect) ?
The other thing is, I did do a sanity check and did a sudo pip install pgdb on the production box and got this:
Requirement already satisfied: pgdb in /usr/lib/python2.7/site-packages
Requirement already satisfied: psycopg2>=2.5.2 in /usr/lib64/python2.7/site-packages (from pgdb)
Also, now this isn't an issue of the name clashing like one poster thought might be a duplicate of. Something else is going on, though interestingly enough when I check the file my os x is using and the file my centos is using for pgdb I get two different answers: (paths wouldn't surprise me but files themselves does)
MacOS X:
>>> pgdb.__file__
'/usr/local/lib/python2.7/site-packages/pgdb.pyc'
CentOS:
>>> pgdb.__file__
'/usr/lib/python2.7/site-packages/pgdb/__init__.pyc'
No idea for the difference.