Re: Help me in error of importing psycopg2 in python
Vu Hong Thuan <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
I've noticed that: in the first time i import psycopg2, i've got the error,
dll load failed. If i retype "import psycopg2", i've got the error about
import tz
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 60, in
<module
>
from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: DLL load failed: The specified procedure could not be found.
>>> import psycopg2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 55, in
<module
>
from psycopg2 import tz
ImportError: cannot import name tz
2009/8/28 Vu Hong Thuan <[email protected]>
> from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
> ImportError: DLL load failed: This application has failed to start
>
> Where is BINARY, NUMBER, STRING, DATETIME, ROWID which psycopg2 import?
>
>
> 2009/8/28 Jason Erickson <[email protected]>
>
>>
>> The links you provided were not the VC2005 ATL Security Update (Note,
>> 2005, NOT 2008). I have included the link again:
>> http://www.microsoft.com/downloads/details.aspx?familyid=766A6AF7-EC73-40FF-B072-9112BAB119C2&displaylang=en
>>
>> -jason
>>
>>
>> On Fri, 28 Aug 2009, Vu Hong Thuan wrote:
>>
>> But not successful, though I've installed vc2008, and vc2008 atl
>>> libraries
>>>
>>> http://www.microsoft.com/downloads/details.aspx?familyid=2051A0C1-C9B5-4B0A-A8F5-770A549FD78C&displaylang=en
>>>
>>> http://www.microsoft.com/downloads/details.aspx?familyid=8B29655E-9DA4-4B6B-9AC5-687CA0770F93&displaylang=en
>>>
>>> http://www.microsoft.com/downloads/thankyou.aspx?familyId=a5c84275-3b97-4ab7-a40d-3802b2af5fc2&displayLang=en
>>>
>>>
>>> 2009/8/28 Jason Erickson <[email protected]>
>>>
>>>
>>>> Harald is correct.
>>>>
>>>> For some reason, when I built the distribution, it sucked in a link or
>>>> two
>>>> to the VC2005 runtime libraries. I guess that's what I get for building
>>>> it
>>>> on a machine with both VC2005 and VC2008 installed, even tho I used the
>>>> VC2008 compiler.
>>>>
>>>> I'm planning on creating a virtual machine with only VC2008 install and
>>>> rebuilding the package so it does not require VC2005, since currently I
>>>> see
>>>> no reason why it is including those old libraries. I'll let the list
>>>> know
>>>> when I've done that.
>>>>
>>>> In the mean time, one can install the VC2005 runtime libraries from
>>>> Microsoft located here:
>>>>
>>>>
>>>> http://www.microsoft.com/downloads/details.aspx?familyid=766A6AF7-EC73-40FF-B072-9112BAB119C2&displaylang=en
>>>>
>>>> Note that Harald's link below probably won't fix it because it is a
>>>> slightly older version of the VC2005 runtime libraries and I believe it
>>>> requires the VC2005 runtimes with the ATL security update with them.
>>>>
>>>> -jason
>>>>
>>>>
>>>>
>>>> On Thu, 27 Aug 2009, Massa, Harald Armin wrote:
>>>>
>>>> Could be a missing
>>>>
>>>>> Microsoft Visual C++ 2005 Redistributable Package (x86)find
>>>>> documentation:
>>>>>
>>>>>
>>>>>
>>>>> http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/36971526-95f3-4a9f-a601-1843c86332c1
>>>>>
>>>>>
>>>>> check out this:
>>>>>
>>>>>
>>>>>
>>>>> http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
>>>>>
>>>>> best wishes,
>>>>>
>>>>> Harald
>>>>>
>>>>>
>>>>> On Thu, Aug 27, 2009 at 5:24 PM, Vu Hong Thuan <[email protected]>
>>>>> wrote:
>>>>>
>>>>> Thank Harald,
>>>>>
>>>>>> But after installing psycopg2 for windows binaries, i get the
>>>>>> following
>>>>>> error
>>>>>> Before installing, _psycopg.pyd depends libpg.dll... I've checked the
>>>>>> permission to these files, all are ok. But i still get the error.
>>>>>> I checked the dependences of the file _psycopg.pyd, it doesn't depend
>>>>>> any
>>>>>> .dll
>>>>>> Would you have any suggestion?
>>>>>>
>>>>>> import psycopg2
>>>>>>>
>>>>>>>>
>>>>>>>>> Traceback (most recent call last):
>>>>>>>>
>>>>>>> File "<stdin>", line 1, in <module>
>>>>>> File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 60,
>>>>>> in
>>>>>> <module
>>>>>>
>>>>>>
>>>>>>> from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
>>>>>>>
>>>>>> ImportError: DLL load failed: This application has failed to start
>>>>>> because
>>>>>> the a
>>>>>> pplication configuration is incorrect. Reinstalling the application
>>>>>> may
>>>>>> fix
>>>>>> this
>>>>>> problem.
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2009/8/27 Massa, Harald Armin <[email protected]>
>>>>>>
>>>>>> Vu,
>>>>>>
>>>>>>
>>>>>>> you should try using the psycopg2 win32 binaries from
>>>>>>>
>>>>>>> http://www.stickpeople.com/projects/python/win-psycopg/
>>>>>>>
>>>>>>> a rough guess is: you did not choose to statically bind all
>>>>>>> dependencies
>>>>>>> within your built psycopg2-module, and a referenced .dll is missing.
>>>>>>>
>>>>>>> Just take the binaries and enjoy,
>>>>>>>
>>>>>>> best wishes,
>>>>>>>
>>>>>>> Harald
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Aug 27, 2009 at 4:59 PM, Vu Hong Thuan <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>> Here is my error, anyone help me
>>>>>>>
>>>>>>>>
>>>>>>>> Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit
>>>>>>>> (Intel)] on
>>>>>>>> win32
>>>>>>>> Type "help", "copyright", "credits" or "license" for more
>>>>>>>> information.
>>>>>>>>
>>>>>>>> import psycopg2
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>
>>>>>>>>> File "<stdin>", line 1, in <module>
>>>>>>>> File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 60,
>>>>>>>> in
>>>>>>>> <module
>>>>>>>>
>>>>>>>>
>>>>>>>>> from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
>>>>>>>>>
>>>>>>>> ImportError: DLL load failed: The specified procedure could not be
>>>>>>>> found.
>>>>>>>>
>>>>>>>> import psycopg2
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> Traceback (most recent call last):
>>>>>>>>>>
>>>>>>>>> File "<stdin>", line 1, in <module>
>>>>>>>> File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 55,
>>>>>>>> in
>>>>>>>> <module
>>>>>>>>
>>>>>>>>
>>>>>>>>> from psycopg2 import tz
>>>>>>>>>
>>>>>>>> ImportError: cannot import name tz
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2009/8/27 Vu Hong Thuan <[email protected]>
>>>>>>>>
>>>>>>>> I've test in postgres 8.3, 8.2, I get the same error,
>>>>>>>>
>>>>>>>>>
>>>>>>>>> 2009/8/27 Vu Hong Thuan <[email protected]>
>>>>>>>>>
>>>>>>>>> Yes, Postgres 8.4,
>>>>>>>>>
>>>>>>>>> Have you ever get this error when using psycopg2 ?
>>>>>>>>>>
>>>>>>>>>> 2009/8/27 Karsten Hilbert <[email protected]>
>>>>>>>>>>
>>>>>>>>>> On Thu, Aug 27, 2009 at 04:47:31PM +0700, Vu Hong Thuan wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> I've installed python 2.6.2 on windows and Postgres 4.0
>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>> Certainly not. 8.4, perhaps ?
>>>>>>>>>>>
>>>>>>>>>>> Karsten
>>>>>>>>>>> --
>>>>>>>>>>> GPG key ID E4071346 @ wwwkeys.pgp.net
>>>>>>>>>>> E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Psycopg mailing list
>>>>>>>>>>> Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
>>>>>>>>>>> http://lists.initd.org/mailman/listinfo/psycopg
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>> Psycopg mailing list
>>>>>>>> Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
>>>>>>>> http://lists.initd.org/mailman/listinfo/psycopg
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> GHUM Harald Massa
>>>>>>> persuadere et programmare
>>>>>>> Harald Armin Massa
>>>>>>> Spielberger Straße 49
>>>>>>> 70435 Stuttgart
>>>>>>> 0173/9409607
>>>>>>> no fx, no carrier pigeon
>>>>>>> -
>>>>>>> LASIK good, steroids bad?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>> GHUM Harald Massa
>>>>> persuadere et programmare
>>>>> Harald Armin Massa
>>>>> Spielberger Straße 49
>>>>> 70435 Stuttgart
>>>>> 0173/9409607
>>>>> no fx, no carrier pigeon
>>>>> -
>>>>> LASIK good, steroids bad?
>>>>>
>>>>>
>>>>
>
_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg