Re: [Qgis-user] qgis 1.8: import error with psycopg2._psycopg (windows)

2013-03-29 Thread Jakob Lanstorp
Deleting OSGeo4W by pressing the delete button on the folder and reinstalling
OSGeo4W solved the problem.
Reinstalling on top of an existing OSGeo4W did not work.



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/qgis-1-8-import-error-with-psycopg2-psycopg-windows-tp4987795p5043688.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] qgis 1.8: import error with psycopg2._psycopg (windows)

2013-03-26 Thread Jakob Lanstorp
Did you fix this problem? I have the same problem killing me. Installed QGIS
1.8 using OSGeo4W on a Windows 7 64bit machine. Sextante and PostGIS manager
plugin not working because psycopg2 is not referenced correctly. Have also
tried installing Python 2.7 and psycopg2 separately. psycopg2 works from
with the Python2.7 but not in QGIS 1.8.0. In the OSGeo4W package selector
the version of psycopg2 is 2.4.1. Is there no way to reinstall a messed up
QGIS in OSGeo4W. Reinstalling Windows might solve the problem, but not an
option right now. Are there some configuration files, paths or setup where
one can see and set the relation between QGIS and the depending libraries.

Jakob



--
View this message in context: 
http://osgeo-org.1560.n6.nabble.com/qgis-1-8-import-error-with-psycopg2-psycopg-windows-tp4987795p5042943.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] qgis 1.8: import error with psycopg2._psycopg (windows)

2012-07-11 Thread Max Bohnet
Today I installed QuantumGIS 1.8 with the osgeo4w-installer - including 
python and psycopg2.
Quantum 1.8 works, but many plugins cannot be used because psycopg2 
cannot be imported:
When i use the python console in QGIS (or a python console with the 
python 2.7 that was installed in C:\osgeo4w\bin) the following error 
occures:



 import psycopg2

Traceback (most recent call last):

File input, line 1, in module

File C:/osgeo4w/apps/qgis/./python\qgis\utils.py, line 309, in _import

mod = _builtin_import(name, globals, locals, fromlist, level)

File 
C:\osgeo4w\apps\Python27\lib\site-packages\psycopg2\__init__.py, 
line 71, in module


from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID

File C:/osgeo4w/apps/qgis/./python\qgis\utils.py, line 309, in _import

mod = _builtin_import(name, globals, locals, fromlist, level)

ImportError: DLL load failed: Das Betriebssystem kann %1 nicht ausführen.





The error is also described in :
http://stackoverflow.com/questions/1306367/importerror-dll-load-failed-when-trying-to-import-psycopg2-library

I have a computer with windows 7 64bit with 32bit python (2.6, 2.7) 
installed.


I have another Python27 installed in C:\Python27
psycopg2 is working there without any problems.

i tried to install another version of psycopg2 (2.3 from osgeo) but 
with the same error.


 - however i did not manage to use the windows installer (it installs 
psycopg2 always in the normal python folder - not in the python in 
osgeo4w).

http://www.stickpeople.com/projects/python/win-psycopg/psycopg2-2.4.5.win32-py2.7-pg9.1.3-release.exe
I tried to change the registry entry for python to redirect it to 
c:\osgeo4w\python27 . But the installation fails.


When i try to install psycopg2 form the source (with easy-install oder 
C:\osgeo4w\bin\python.exe setup.py install) the following error 
occures,when  building the _psycopg file:
C:\osgeo4w\bin\psycopg2-2.4.5C:\MinGW\bin\gcc.exe -mno-cygwin -mdll 
-O -Wall -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=\2.4.5 (dt 
dec pq3 ext)\ -DPG_VERSION_HEX=0x090005 -DPSYCOPG_EXTENSIONS=1 
-DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFR
EEMEM=1 -IC:\Python27\include-IC:\Python27\PC -I. 
-IC:/PROGRA~2/POSTGR~1/9.0/include 
-IC:/PROGRA~2/POSTGR~1/9.0/include/server -c psycopg\psycopgmodule.c 
-o build\temp.win32-2.7\Release\psycopg\psycopgmodule.o -O3 
-fno-strict-aliasing

cc1.exe: error: unrecognized command line option '-mno-cygwin'

i tried to remove the occurence of -mno-cygwin in
C:\osgeo4w\apps\python27\Lib\distutils\cygwinccompiler.py
as described in
http://stackoverflow.com/questions/9645004/python-mno-cygwin
but that does not help.
If i try to execute the command without -mno-cygwin

C:\osgeo4w\bin\psycopg2-2.4.5C:\MinGW\bin\gcc.exe -mdll -O -Wall 
-DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION=\2.4.5 (dt dec pq3 
ext)\ -DPG_VERSION_HEX=0x090005 -DPSYCOPG_EXTENSIONS=1 
-DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFR
EEMEM=1 -IC:\Python27\include-IC:\Python27\PC -I. 
-IC:/PROGRA~2/POSTGR~1/9.0/include 
-IC:/PROGRA~2/POSTGR~1/9.0/include/server -c psycopg\psycopgmodule.c -o 
build\temp.win32-2.7\Release\psycopg\psycopgmodule.o -O3 
-fno-strict-aliasing


he complains because of a missing python.h file.

I tried to reinstall the osgeo4w-python-core and psycopg2, but the 
problem is still there.


Has anyone an idea, what other solutions i could try?
Is there a possibility to use my normal python2.7 installation on 
c:\python27 for QuantumGIS?


Thanks in advance for any help,

Max
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user