Git Product home page Git Product logo

pyspatialite's Introduction

This repository is being archived

Python and Spatialite has come a long way, and this package is no longer as useful as it once was.

Python interface to Spatialite

pyspatialite is an interface to the SQLite 3.x embedded relational database engine with spatialite extensions.

It is almost fully compliant with the Python database API version 2.0 and also exposes the unique features of SQLite and spatialite.

Installation

pip install pyspatialite

Pre-release Installation

In some cases, the most recent pypi release may be in a pre-release stage. In order to install pre-release packages, you must include the option '--pre' in your pip command:

pip install --pre pyspatialite

Usage

pyspatialite extends the sqlite3 interface, and so can be used in place of sqlite3 when modelling spatial information. The main interface is contained in the pyspatialite.dbapi2 package:

import pyspatialite.dbapi2 as db

con = db.connect(':memory:')

# Test that the spatialite extension has been loaded:
cursor = con.execute('SELECT sqlite_version(), spatialite_version()')
print cursor.fetchall()
# Output should be something like: [(u'3.7.9', u'3.0.1')]

For more information on simple pyspatialite usage, see http://www.gaia-gis.it/spatialite-2.4.0-4/splite-python.html

Bitdeli Badge

pyspatialite's People

Contributors

bitdeli-chef avatar cboos avatar cristiancantoro avatar ghaering avatar ikselven avatar judy2k avatar lokkju avatar sebastic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyspatialite's Issues

Move from deprecated spatialite_init() method to spatialite_init_ex()

pyspatialite has become unusable in Debian after libspatialite was rebuilt with libproj 4.9.1, because it still uses the deprecated spatialite_init() method which is intrinsically thread unsafe and now causes segfaults.

This issue was first reported for the spatialite-bin package in Debian Bug #785091, but it affects all software built on top of libspatialite.

SpatiaLite upstream has deprecated the spatialite_init() method in favour of the spatialite_init_ex() method some time ago. See the related discussion on the gdal-dev, qgis-developer & spatialite-users lists for backgrounds and porting instructions.

PySpatialite Install Fails

From daniel.sokolowski.81 on February 08, 2013 09:59:54

What steps will reproduce the problem? 1. pip install pyspatialite What is the expected output? What do you see instead? Installation fails:

File "/srv/www/django/development.yupifoods.com/virtualenv/src/goog/setup.py", line 116, in build_extension

get_amalgamation()

File "/srv/www/django/development.yupifoods.com/virtualenv/src/goog/setup.py", line 97, in get_amalgamation

download_file = pattern.findall(download_page)[0] What version of the product are you using? On what operating system? Latest pyspatial lite install and Debian 6.x Please provide any additional information below. - I see in the code that the amalgamation files are downloaded and if the download site changes it brakes that code, is there any reason not to just include those files with the package?

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=11

previous declaration of ‘spatialite_init’ was here

From ziade.tarek on May 30, 2013 03:48:45

If I try to compile the latest release I get

...
src/connection.h:36:5: error: conflicting types for ‘spatialite_init’
/usr/include/spatialite.h:92:29: note: previous declaration of ‘spatialite_init’ was here
...

That's because connection.h defines spatialite_init, but it's already imported from spatialite.h

Removing the declaration in connection.h works for me

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=13

failed to build on snow leopard, lipo: can't open input file

From rosskarchner on April 26, 2011 06:18:59

What steps will reproduce the problem? I'm getting the same error as issue one, but I can confirm that the necessary frameworks are in fact installed. What is the expected output? What do you see instead? I expect it to build ;)

rosskarchner:pyspatialite rosskarchner$ cat setup.cfg.OSX
[build_ext]

define=

include_dirs=/Library/Frameworks/GEOS.framework/unix/include/:/Library/Frameworks/PROJ.framework/unix/include/
library_dirs=/Library/Frameworks/GEOS.framework/unix/lib:/Library/Frameworks/PROJ.framework/unix/lib

rosskarchner:pyspatialite rosskarchner$ mv setup.cfg.OSX setup.cfg
rosskarchner:pyspatialite rosskarchner$ ls /Library/Frameworks/GEOS.framework/unix/include/
geos geos.h geos_c.h
rosskarchner:pyspatialite rosskarchner$ ls /Library/Frameworks/PROJ.framework/unix/include/
nad_list.h org_proj4_Projections.h proj_api.h projects.h
rosskarchner:pyspatialite rosskarchner$ ls /Library/Frameworks/GEOS.framework/unix/lib
libgeos.dylib libgeos_c.dylib
rosskarchner:pyspatialite rosskarchner$ ls /Library/Frameworks/PROJ.framework/unix/lib
libproj.a libproj.dylib
rosskarchner:pyspatialite rosskarchner$ python2.5 s
scripts/ setup.cfg setup.py src/
rosskarchner:pyspatialite rosskarchner$ python2.5 setup.py build
running build
running build_py
creating build
creating build/lib.macosx-10.6-i386-2.5
creating build/lib.macosx-10.6-i386-2.5/pyspatialite
copying lib/init.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite
copying lib/dbapi2.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite
copying lib/dump.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite
creating build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/init.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/dbapi.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/dump.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/factory.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/hooks.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/regression.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/spatial.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/transactions.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/types.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
copying lib/test/userfunctions.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test
creating build/lib.macosx-10.6-i386-2.5/pyspatialite/test/py25
copying lib/test/py25/init.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test/py25
copying lib/test/py25/py25tests.py -> build/lib.macosx-10.6-i386-2.5/pyspatialite/test/py25
running build_ext
Downloading amalgation.
Extracting sqlite3.c
Extracting headers/spatialite/sqlite3.h
Extracting spatialite.c
Extracting headers/spatialite/sqlite3ext.h
Extracting headers/spatialite/spatialite.h
Extracting headers/spatialite/gaiaaux.h
Extracting headers/spatialite/gaiaexif.h
Extracting headers/spatialite/gaiageo.h
building 'pyspatialite._spatialite' extension
creating build/temp.macosx-10.6-i386-2.5
creating build/temp.macosx-10.6-i386-2.5/src
creating build/temp.macosx-10.6-i386-2.5/amalgamation
gcc-4.2 -fno-strict-aliasing -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe -DMODULE_NAME="spatialite.dbapi2" -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -Iamalgamation -I/Library/Frameworks/GEOS.framework/unix/include/ -I/Library/Frameworks/PROJ.framework/unix/include/ -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/module.c -o build/temp.macosx-10.6-i386-2.5/src/module.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
src/module.c:457: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/2n/2n3-Ec-tEoe77rVLPKg4O++++TM/-Tmp-//ccslDZlg.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1 What version of the product are you using? On what operating system? I tried python 2.5 and 2.6, on OS X Snow Leopard

Darwin rosskarchner.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=4

‘PyInt_Type’ undeclared

i try to install pyspacialite on python2.7 and python3.6, but neither success.

src/module.c: In function ‘module_register_adapter’:
src/module.c:158:18: error: ‘PyInt_Type’ undeclared (first use in this function)
     if (type == &PyInt_Type || type == &PyLong_Type || type == &PyFloat_Type
                  ^
src/module.c:158:18: note: each undeclared identifier is reported only once for each function it appears in
src/module.c:159:25: error: ‘PyString_Type’ undeclared (first use in this function)
             || type == &PyString_Type || type == &PyUnicode_Type || type == &Py
                         ^
src/module.c:159:78: error: ‘PyBuffer_Type’ undeclared (first use in this function)
    || type == &PyString_Type || type == &PyUnicode_Type || type == &PyBuffer_Ty
                                                                     ^
src/module.c: In function ‘init_spatialite’:
src/module.c:309:14: warning: implicit declaration of function ‘Py_InitModule’ [-Wimplicit-function-declaration]
     module = Py_InitModule("pyspatialite._spatialite", module_methods);
              ^
src/module.c:309:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     module = Py_InitModule("pyspatialite._spatialite", module_methods);
            ^
src/module.c:319:9: warning: ‘return’ with no value, in function returning non-void
         return;
         ^
src/module.c:341:69: error: ‘PyExc_StandardError’ undeclared (first use in this function)
     if (!(pysqlite_Error = PyErr_NewException(MODULE_NAME ".Error", PyExc_Stand
                                                                     ^
src/module.c:405:19: warning: implicit declaration of function ‘PyInt_FromLong’ [-Wimplicit-function-declaration]
         tmp_obj = PyInt_FromLong(_int_constants[i].constant_value);
                   ^
src/module.c:405:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         tmp_obj = PyInt_FromLong(_int_constants[i].constant_value);
                 ^
src/module.c:413:21: warning: implicit declaration of function ‘PyString_FromString’ [-Wimplicit-function-declaration]
     if (!(tmp_obj = PyString_FromString(PYSPATIALITE_VERSION))) {
                     ^
src/module.c:413:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     if (!(tmp_obj = PyString_FromString(PYSPATIALITE_VERSION))) {
                   ^
src/module.c:419:19: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     if (!(tmp_obj = PyString_FromString(sqlite3_libversion()))) {
                   ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

lipo: can't open input file: /var/folders/M6/M6IVBPvkFlG2R1gxiKlBqE+++TI/-Tmp-//ccjgs4HE.out (No such file or directory)

From [email protected] on May 15, 2010 04:14:36

What steps will reproduce the problem? 1. execute python setup.py install What is the expected output? What do you see instead? I ommit a long list of errors and warnings since I do not know how to
redirect "setup.py install" output into a file.

the last two lines:

lipo: can't open input file:
/var/folders/M6/M6IVBPvkFlG2R1gxiKlBqE+++TI/-Tmp-//ccSOYlxe.out (No such
file or directory)
error: command 'gcc-4.2' failed with exit status 1 What version of the product are you using? On what operating system? uname -a
Darwin Macintosh-4.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26
11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386 Please provide any additional information below.

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=1

Error after patching setup.py

From uwe.seher on February 12, 2013 06:34:29

What steps will reproduce the problem? 1. patch the original setup.py
2. run python setup.py install What is the expected output? What do you see instead? I expect a working module, i see the error below.
I do it this way, because easy_install doesnt work with pyspatialite-3.0.1.
Version pyspatialite 2.6.2-spatialite.2.4.0-4 installs without problems via easy_install. What version of the product are you using? On what operating system? pyspatialite-3.0.1, opensuse 12.1, python 2.7, libspatialite 3.0.1 or 4.0.0 Please provide any additional information below. (testenv)useher@deimos:/devel/testenv/pyspatialite-3.0.1> patch -i fix_3.0.1_build_after_libspatialite_introduced_version_4.0.patch
patching file setup.py
(testenv)useher@deimos:
/devel/testenv/pyspatialite-3.0.1> python setup.py install
running install
running build
running build_py
running build_ext
creating tmp
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/python2.7 -c /tmp/iconvCfAzAD.c -o tmp/iconvCfAzAD.o
/tmp/iconvCfAzAD.c:1:1: warning: return type defaults to ‘int’ [-Wreturn-type]
/tmp/iconvCfAzAD.c: In function ‘main’:
/tmp/iconvCfAzAD.c:2:5: warning: implicit declaration of function ‘iconv’ [-Wimplicit-function-declaration]
/tmp/iconvCfAzAD.c:3:1: warning: control reaches end of non-void function [-Wreturn-type]
gcc -pthread tmp/iconvCfAzAD.o -L/usr/lib64 -o a.out
building 'pyspatialite._spatialite' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/amalgamation
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -DMODULE_NAME="spatialite.dbapi2" -DVERSION="3.0.1" -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 -DOMIT_FREEXL=1 -I/Library/Frameworks/GEOS.framework/unix/include/ -I/Library/Frameworks/PROJ.framework/unix/include/ -Iamalgamation -I/usr/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o
In file included from src/module.c:24:0:
src/connection.h:36:5: error: conflicting types for ‘spatialite_init’
/usr/include/spatialite.h:82:29: note: previous declaration of ‘spatialite_init’ was here
error: command 'gcc' failed with exit status 1
(testenv)useher@deimos:~/devel/testenv/pyspatialite-3.0.1>

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=12

Fails to retrieve libspatialite after it went 4.0

From timperi on November 27, 2012 02:32:36

What steps will reproduce the problem? 1. pip install pyspatialite What is the expected output? What do you see instead? Expectation is that the package is installed succesfully. Instead the build fails because it can't find the libspatialite-amalgamation archive:

File "/home/otimperi/venv/build/pyspatialite/setup.py", line 97, in get_amalgamation

download_file = pattern.findall(download_page)[0]

IndexError: list index out of range What version of the product are you using? On what operating system? Version 3.0.1, the one currently available in PyPI. Please provide any additional information below. I attached a patch that should fix the problem.

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=9

Build fails with 3 errors

From rob.walshaw2 on July 30, 2012 20:06:55

What steps will reproduce the problem? 1. Build all lib dependencies (iconv, geos, geos_c, proj4) with MSVC 2008 / SDK7.0 x64
2. Add \bin, \lib, and \include dependency paths to setup.cfg (or directly to setup.py)
3. Run 'python setup.py build' What is the expected output? What do you see instead? Build should complete creation of all libs, dlls, etc. and be ready to perform install. Instead, build is failing with the following errors...

spatialite.c
amalgamation\spatialite.c(69910) : error C2075: 'spatialiteversion' : array initialization needs curly braces
amalgamation\spatialite.c(69910) : error C2143: syntax error : missing ';' before 'constant'
lex.VanuatuWkt.c(1637) : warning C4273: '_isatty' : inconsistent dll linkage
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\io.h(201) : see previous definition of '_isatty'
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\amd64\cl.exe"' failed with exit status 2 What version of the product are you using? On what operating system? Win7 x64
MSVC 2008
SDK 7.0 x64
Python 2.7.3
iconv 1.9.2
proj4 4.8.0
geos 3.3.5
pyspatialite 3.0.1 Please provide any additional information below. I've tried compiling all dependency libraries with mingw-w64 and MSVC 2008, as well as compiling pyspatialite using the default MSVC and mingw-w64 (created a special subclass that calls mingw-w64 rather than mingw32). All methods fail during compile with the same errors above.
Is it possible that VERSION is not in the format that spatialiteversion[] is expecting?

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=7

Does not find libgeos

On my system (Debian sid, amd64), there is no /usr/lib/libgeos.so, only /usr/lib/libgeos-3.4.2.so. This of course results in an error: /usr/bin/ld: cannot find -lgeos (tested with pyspatialite-3.0.1-alpha-0).

Manually changing the check_lib line for geos and geosadvanced to the following

self.check_lib(ext,"GEOSTopologyPreserveSimplify","geos_c","'libgeos_c' is required but it doesn't seem to be installed on this system.",["m","geos-3.4.2"])

makes pyspatialite build successfully. A possible solution is to use the output of geos-config for finding the right lib:

$ geos-config --libs
-L/usr/lib -lgeos-3.4.2

easy_install fails

From melfromalice on January 17, 2013 16:59:47

What steps will reproduce the problem? 1. (python 2.6)run easy_install pyspatialite 2. 3. What is the expected output? What do you see instead? expect to be able to work with pyspatialite, instead I get an error:

c:\Python26\Scripts>easy_install pyspatialite
Searching for pyspatialite
Reading http://pypi.python.org/simple/pyspatialite/ Reading http://pyspatialite.googlecode.com/ Reading http://code.google.com/p/pyspatialite/downloads/list Best match: pyspatialite 3.0.1
Downloading http://pypi.python.org/packages/source/p/pyspatialite/pyspatialite-3 .0.1.tar.gz#md5=28a6ab34b5003772e9468f2712100586
Processing pyspatialite-3.0.1.tar.gz
Running pyspatialite-3.0.1\setup.py -q bdist_egg --dist-dir c:\users\mruff\appda
ta\local\temp\easy_install-selpqq\pyspatialite-3.0.1\egg-dist-tmp-gngk16
Downloading amalgation.
Traceback (most recent call last):
File "c:\Python26\Scripts\easy_install-script.py", line 8, in
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
1712, in main
with_ei_usage(lambda:
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
1700, in with_ei_usage
return f()
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
1716, in
distclass=DistributionWithoutHelpCommands, **kw
File "c:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "c:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
211, in run
self.easy_install(spec, not self.no_deps)
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
446, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
476, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
655, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
930, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "c:\Python26\lib\site-packages\setuptools\command\easy_install.py", line
919, in run_setup
run_setup(setup_script, args)
File "c:\Python26\lib\site-packages\setuptools\sandbox.py", line 62, in run_se
tup
lambda: execfile(
File "c:\Python26\lib\site-packages\setuptools\sandbox.py", line 105, in run
return func()
File "c:\Python26\lib\site-packages\setuptools\sandbox.py", line 64, in
{'file':setup_script, 'name':'main'}
File "setup.py", line 219, in
File "setup.py", line 216, in main
File "c:\Python26\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\Python26\lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "c:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\Python26\lib\site-packages\setuptools\command\bdist_egg.py", line 175
, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "c:\Python26\lib\site-packages\setuptools\command\bdist_egg.py", line 161
, in call_command
self.run_command(cmdname)
File "c:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "c:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\Python26\lib\site-packages\setuptools\command\install_lib.py", line 2
0, in run
self.build()
File "c:\Python26\lib\distutils\command\install_lib.py", line 112, in build
self.run_command('build_ext')
File "c:\Python26\lib\distutils\cmd.py", line 333, in run_command
self.distribution.run_command(command)
File "c:\Python26\lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "c:\Python26\lib\distutils\command\build_ext.py", line 343, in run
self.build_extensions()
File "c:\Python26\lib\distutils\command\build_ext.py", line 469, in build_exte
nsions
self.build_extension(ext)
File "setup.py", line 116, in build_extension
File "setup.py", line 97, in get_amalgamation
IndexError: list index out of range

c:\Python26\Scripts>
----------------------------------- What version of the product are you using? On what operating system? Windows 7, python2.6, pyspatialite 3.0.1 Please provide any additional information below.

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=10

Unclear licensing

From d.paleino on April 23, 2011 00:26:10

Hello,
I'm packaging pyspatialite for Debian, and I have problems with the license of this software.

In the tarball, there is a LICENSE file containing the zlib/libpng license, with copyright 2004-2007 Gerhard Häring.

PKG-INFO contains Lokkju Brennr as author, and doesn't mention Gerhard Häring at all.

The homepage says the license is MIT, and the only contributor is Lokkju Brennr.

Would you please clarify the situation?

Thanks,
David

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=3

Error build in Arch Linux

I get the next error building in Arch Linux with Spatialite version 4.3.0.

-> pyspatialite-3.0.1-alpha-0.tar.gz ha sido encontrado
-> setup.cfg ha sido encontrado
==> Validando los archivos source con md5sums…
pyspatialite-3.0.1-alpha-0.tar.gz ... Aprobado
setup.cfg ... Aprobado
==> Extrayendo las fuentes…
-> Extrayendo pyspatialite-3.0.1-alpha-0.tar.gz con bsdtar
==> Eliminando el directorio $pkgdir/…
==> Iniciando build()…
/usr/lib/python2.7/site-packages/setuptools/dist.py:331: UserWarning: Normalizing '3.0.1-alpha-0' to '3.0.1a0'
normalized_version,
running build
running build_py
running build_ext
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python2.7 -c /tmp/pj_init_plust4U7KT.c -o tmp/pj_init_plust4U7KT.o
/tmp/pj_init_plust4U7KT.c:1:1: aviso: el tipo de devolución por defecto es ‘int’ [-Wimplicit-int]
main (int argc, char *_argv) {
^~~~
/tmp/pj_init_plust4U7KT.c: En la función ‘main’:
/tmp/pj_init_plust4U7KT.c:2:5: aviso: declaración implícita de la función ‘pj_init_plus’ [-Wimplicit-function-declaration]
pj_init_plus();
^~~~~~~~~~~~
gcc -pthread tmp/pj_init_plust4U7KT.o -L/usr/lib -L/usr/lib -L/usr/lib -L/usr/lib -lm -lproj -lspatialite -o a.out
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python2.7 -c /tmp/GEOSTopologyPreserveSimplifyS7NwXv.c -o tmp/GEOSTopologyPreserveSimplifyS7NwXv.o
/tmp/GEOSTopologyPreserveSimplifyS7NwXv.c:1:1: aviso: el tipo de devolución por defecto es ‘int’ [-Wimplicit-int]
main (int argc, char *_argv) {
^~~~
/tmp/GEOSTopologyPreserveSimplifyS7NwXv.c: En la función ‘main’:
/tmp/GEOSTopologyPreserveSimplifyS7NwXv.c:2:5: aviso: declaración implícita de la función ‘GEOSTopologyPreserveSimplify’ [-Wimplicit-function-declaration]
GEOSTopologyPreserveSimplify();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/usr/include/python2.7 -c /tmp/iconvRfbbif.c -o tmp/iconvRfbbif.o
/tmp/iconvRfbbif.c:1:1: aviso: el tipo de devolución por defecto es ‘int’ [-Wimplicit-int]
main (int argc, char *_argv) {
^~~~
/tmp/iconvRfbbif.c: En la función ‘main’:
/tmp/iconvRfbbif.c:2:5: aviso: declaración implícita de la función ‘iconv’ [-Wimplicit-function-declaration]
iconv();
^~~~~
building 'pyspatialite.spatialite' extension
gcc -pthread -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -DVERSION="3.0.1" -DSQLITE_ENABLE_RTREE=1 -DNDEBUG=1 -DSPL_AMALGAMATION=1 -DMODULE_NAME="spatialite.dbapi2" -DHAVE_PROJ_API_H=1 -DHAVE_GEOS_C_H=1 -Iamalgamation/libspatialite-amalgamation-3.0.1/headers -I/usr/include -I/usr/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o -DOMIT_FREEXL
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:650:8: error: redefinición de ‘struct sqlite3_file’
struct sqlite3_file {
^~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:818:16: nota: se definió originalmente aquí
typedef struct sqlite3_file sqlite3_file;
^~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:745:8: error: redefinición de ‘struct sqlite3_io_methods’
struct sqlite3_io_methods {
^~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:820:16: nota: se definió originalmente aquí
const struct sqlite3_io_methods *pMethods; /
Methods for an open file */
^~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:1219:8: error: redefinición de ‘struct sqlite3_vfs’
struct sqlite3_vfs {
^~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:1198:16: nota: se definió originalmente aquí
typedef struct sqlite3_vfs sqlite3_vfs;
^~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:1516:8: error: redefinición de ‘struct sqlite3_mem_methods’
struct sqlite3_mem_methods {
^~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:1493:16: nota: se definió originalmente aquí
typedef struct sqlite3_mem_methods sqlite3_mem_methods;
^~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:5791:8: error: redefinición de ‘struct sqlite3_module’
struct sqlite3_module {
^~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5012:16: nota: se definió originalmente aquí
typedef struct sqlite3_module sqlite3_module;
^~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:5922:8: error: redefinición de ‘struct sqlite3_index_info’
struct sqlite3_index_info {
^~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5010:16: nota: se definió originalmente aquí
typedef struct sqlite3_index_info sqlite3_index_info;
^~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:5925:10: error: redefinición de ‘struct sqlite3_index_constraint’
struct sqlite3_index_constraint {
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5121:10: nota: se definió originalmente aquí
struct sqlite3_index_constraint {
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:5932:10: error: redefinición de ‘struct sqlite3_index_orderby’
struct sqlite3_index_orderby {
^~~~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5128:10: nota: se definió originalmente aquí
struct sqlite3_index_orderby {
^~~~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:5937:10: error: redefinición de ‘struct sqlite3_index_constraint_usage’
struct sqlite3_index_constraint_usage {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5133:10: nota: se definió originalmente aquí
struct sqlite3_index_constraint_usage {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:6035:8: error: redefinición de ‘struct sqlite3_vtab’
struct sqlite3_vtab {
^~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5009:16: nota: se definió originalmente aquí
typedef struct sqlite3_vtab sqlite3_vtab;
^~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:6059:8: error: redefinición de ‘struct sqlite3_vtab_cursor’
struct sqlite3_vtab_cursor {
^~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5011:16: nota: se definió originalmente aquí
typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor;
^~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:6554:8: error: redefinición de ‘struct sqlite3_mutex_methods’
struct sqlite3_mutex_methods {
^~~~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:5710:16: nota: se definió originalmente aquí
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods;
^~~~~~~~~~~~~~~~~~~~~
In file included from src/statement.h:29:0,
from src/module.c:25:
/usr/include/sqlite3.h:7280:8: error: redefinición de ‘struct sqlite3_pcache_methods’
struct sqlite3_pcache_methods {
^~~~~~~~~~~~~~~~~~~~~~
In file included from src/connection.h:33:0,
from src/module.c:24:
amalgamation/libspatialite-amalgamation-3.0.1/headers/spatialite/sqlite3.h:6325:16: nota: se definió originalmente aquí
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods;
^~~~~~~~~~~~~~~~~~~~~~
error: command 'gcc' failed with exit status 1
==> ERROR: Se produjo un fallo en build().
Cancelando…

Install in virtualenv fails because it does not include system libraries

(I am using Ubuntu 12.10 on a x86_64 system)

Steps to reproduce

  1. make sure that all the needed libraries are installed. For reference on a Ubuntu system this means:
    apt-get install python-dev
    apt-get install libgoes-dev
    apt-get install libproj-dev
    apt-get install libsqlite3-dev
    this blog post has more information for a system install of pyspatialite on Ubuntu 12.04, 12.10 and 13.04
  2. create a virtualenv named "pyspatialite-test"
    mkvirtualenv pyspatialite-test
  3. try to pip install spatialite

Install should fail with:
__main__.HeaderNotFoundException: cannot find proj_api.h, bailing out
(complete pip log is here)

A simple search reveals that proj_api.h is present:
$ locate proj_api.h
/usr/include/proj_api.h

The problem is in the setup script because neither the variable include_dirs nor self.compiler.include_dirs contain /usr/include

The two following include paths (on Linux system) should be added:

  • /usr/local/include
  • /usr/include

Adding them manually to setup.py solves the issue and the package install successfully.

Usage of discontinued libspatialite-amalgamation-3.0.1

For many years now, the spatialite project has encouraged the removal of libspatialite-amalgamation in any project.
Yesterday a problem was reported in context with pyspatialite

https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/spatialite-users/anQTy_YyqKg

which I have now just answered.


I would _strongly_ suggest the removal amalgamation/libspatialite-amalgamation-3.0.1 and add a dependency on the locally installed sqlite and spatialite library.

Also, it seems, when building/installing pyspatialite, if a dependency has not been found, it will nevertheless install.
In this case it looks as if proj4 was not installed

__main__.HeaderNotFoundException: cannot find proj_api.h, bailing out

Despite the 'bailing out', the user was still able to use the plugins (??)


To make matters worse, there are qgis plugins Qspatialite, that uses pyspatialite, that attempt to repair - what it considers a faulty spatialite-db, using the libspatialite-amalgamation-3.0.1 logic.
In this case it will consider any spatialite database 4.0 until present as faulty, issues a (3.0.1) initspatialmetadata() - thus creating a obsolete 3.0.1 structure in a valid 4.* Database.


Since the spatialite api is very capable of repairing a database created in a previous version, locally installed version of spatilite should be used by pyspatialite. Today one can assume that 90% of the default installations are at least 4.0.
For many years now, the spatialite project has encouraged the removal of libspatialite-amalgamation in any project.
Yesterday a problem was reported in context with pyspatialite

https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!topic/spatialite-users/anQTy_YyqKg

which I have now just answered.


I would _strongly_ suggest the removal amalgamation/libspatialite-amalgamation-3.0.1 and add a dependency on the locally installed sqlite and spatialite library.

Also, it seems, when building/installing pyspatialite, if a dependency has not been found, it will nevertheless install.
In this case it looks as if proj4 was not installed

/tmp/pj_init_plusYXmJBy.c:2:5: warning: implicit declaration of function ‘pj_init_plus’ [-Wimplicit-function-declaration]
pj_init_plus();

To make matters worse, there are qgis plugins Qspatialite, that uses pyspatialite, that attempt to repair - what it considers a faulty spatialite-db, using the libspatialite-amalgamation-3.0.1 logic.
In this case it will consider any spatialite database 4.0 until present as faulty, issues a (3.0.1) initspatialmetadata() - thus creating a obsolete 3.0.1 structure in a valid 4.* Database.


Since the spatialite api is very capable of repairing a database created in a previous version, a locally installed version of spatialite should be used by pyspatialite. Today one can assume that 90% of the default installations are at least 4.0.
A amalgamation-3.0.1, can however, never be able to repair a database created with a future version. Even the update of a 4.* Database through a hardcoded amalgamation-3.0.1 could damage the database.
This is one, of the many reasons why libspatialite-amalgamation should no longer be used.

I will be send a note to the qgis-development, encouraging the discontinuation of all plugins using a libspatialite-amalgamation.

Error in install

While installing in windows using pip i am getting an error saying missing semi colon in setup file. I tried edit, seems like a lot of indent issues. writing this as i didnt got succeeded in my installation of pyspatialite. Please suggest a way

Python 3 support

The command:

python3 -m pip install pyspatialite

fails with this traceback:

Collecting pyspatialite
  Using cached pyspatialite-3.0.1-alpha-0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/tmp/pip-build-y10vod4q/pyspatialite/setup.py", line 66
        print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
                                                                           ^
    SyntaxError: Missing parentheses in call to 'print'

Seems like the print-functions and some other things need updating for Python 3.

Package doesn't build correctly on Win7_x64 with MinGW compiler

From tobiasschmitz94 on November 19, 2013 06:18:40

What steps will reproduce the problem? 1. satisfiing Dependencies.
2. run: python setup.py build -c mingw32 install (PATH points to gcc-Compiler from C:\MinGW64) What is the expected output? What do you see instead? The expected output would be a compiled build...

Instead it stops with no reasonable Errormessage:

lex.Gml.c:851:1: warning: label 'find_rule' defined but not used [-Wunused-label]
gmlLexer.l: At top level:
amalgamation\spatialite.c:190017:19: warning: 'vanuatu_yyunput' defined but not used [-Wunused-function]
#define yyunput vanuatu_yyunput
^
lex.VanuatuWkt.c:1415:17: note: in expansion of macro 'yyunput'
amalgamation\spatialite.c:189973:17: warning: 'vanuatu_input' defined but not used [-Wunused-function]
#define input vanuatu_input
^
lex.VanuatuWkt.c:1456:16: note: in expansion of macro 'input'
lex.VanuatuWkt.c:3886:19: warning: 'ewkt_yyunput' defined but not used [-Wunused-function]
lex.Ewkt.c:1295:17: note: in expansion of macro 'yyunput'
lex.VanuatuWkt.c:3842:17: warning: 'ewkt_input' defined but not used [-Wunused-function]
lex.Ewkt.c:1336:16: note: in expansion of macro 'input'
lex.Ewkt.c:3249:19: warning: 'geoJSON_yyunput' defined but not used [-Wunused-function]
lex.GeoJson.c:1346:17: note: in expansion of macro 'yyunput'
lex.Ewkt.c:3205:17: warning: 'geoJSON_input' defined but not used [-Wunused-function]
lex.GeoJson.c:1387:16: note: in expansion of macro 'input'
lex.GeoJson.c:3899:19: warning: 'kml_yyunput' defined but not used [-Wunused-function]
lex.Kml.c:1183:17: note: in expansion of macro 'yyunput'
lex.GeoJson.c:3855:17: warning: 'kml_input' defined but not used [-Wunused-function]
lex.Kml.c:1224:16: note: in expansion of macro 'input'
lex.Kml.c:4839:19: warning: 'gml_yyunput' defined but not used [-Wunused-function]
lex.Gml.c:1235:17: note: in expansion of macro 'yyunput'
lex.Gml.c:1890:12: warning: 'yy_flex_strlen' defined but not used [-Wunused-function]
lex.Kml.c:4795:17: warning: 'gml_input' defined but not used [-Wunused-function]
lex.Gml.c:1280:16: note: in expansion of macro 'input'
error: command 'gcc' failed with exit status 1 What version of the product are you using? On what operating system? pyspatialite-3.0.1

Windows 7 x64
python2.7 Please provide any additional information below. On Ubuntu I was able to build it with not tooo much struggling.
For windows this seems impossible...

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=16

Support for spatialite 4.1.x ?

Hi,

Curious if the current version will work fine (or in a limited manner) with spatialite 4.1.x? Or, any idea when support for 4.1.x will become available?

pyspatialite is used by the DB Manager core Python plugin in the upcoming version of QGIS (2.0), and it would be handy to have full spatialite 4.1.x support if possible.

Regards,

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=15

pip installation fails.

From mapes911 on January 03, 2012 19:47:00

What steps will reproduce the problem? 1. Use Ubuntu 11.10
2. sudo aptitude install build-essential gcc g++ make dkms python-setuptools python-dev dpkg-dev -y
3. sudo aptitude install libgeos-3.2.2 libgeos-dev libproj0 libproj-dev -y
4. sudo pip install pyspatialite What is the expected output? What do you see instead? Expected output is to have pip build and successfully install.
This has worked in the past.

Over the past several days, I've seen the following errors:

$ pip install pyspatialite
Downloading/unpacking pyspatialite
Downloading pyspatialite-2.6.1.tar.gz (74Kb): 74Kb downloaded
Running setup.py egg_info for package pyspatialite
Installing collected packages: pyspatialite
Running setup.py install for pyspatialite
Downloading amalgation.
Traceback (most recent call last):
File "", line 1, in
File "/home/ME/build/pyspatialite/setup.py", line 207, in

main()
File "/home/ME/build/pyspatialite/setup.py", line 204, in main
setup(**get_setup_args())
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in
run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in
run_command
cmd_obj.run()
File "/home/ME/.virtualenvs/MYVIRTUALENV/local/lib/python2.7/
site-packages/setuptools-0.6c11-py2.7.egg/setuptools/command/
install.py", line 56, in run
File "/usr/lib/python2.7/distutils/command/install.py", line
601, in run
self.run_command('build')
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in
run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in
run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build.py", line 128,
in run
self.run_command(cmd_name)
File "/usr/lib/python2.7/distutils/cmd.py", line 326, in
run_command
self.distribution.run_command(command)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in
run_command
cmd_obj.run()
File "/usr/lib/python2.7/distutils/command/build_ext.py", line
340, in run
self.build_extensions()
File "/usr/lib/python2.7/distutils/command/build_ext.py", line
449, in build_extensions
self.build_extension(ext)
File "/home/ME/.virtualenvs/MYVIRTUALENV/build/pyspatialite/
setup.py", line 116, in build_extension
get_amalgamation()
File "/home/ME/.virtualenvs/MYVIRTUALENV/build/pyspatialite/
setup.py", line 97, in get_amalgamation
download_file = pattern.findall(download_page)[0]
IndexError: list index out of range What version of the product are you using? On what operating system? 2.6.1
Ubuntu 11.10

Thanks in advance for looking into this!

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=5

Error to build pyspatialite-3.0.1 on mac os x 10.8.2

From guiguan on October 04, 2012 19:22:11

What steps will reproduce the problem? 1. sudo python setup.py build What is the expected output? What do you see instead? running build
running build_py
running build_ext
/usr/bin/cc -fno-strict-aliasing -O3 -w -pipe -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/Cellar/python/2.7.2/include/python2.7 -c /tmp/iconvL0nCeB.c -o tmp/iconvL0nCeB.o
/usr/bin/cc tmp/iconvL0nCeB.o -o a.out
Undefined symbols for architecture x86_64:
"_iconv", referenced from:
_main in iconvL0nCeB.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation) What version of the product are you using? On what operating system? pyspatialite-3.0.1 and mac os x 10.8.2 Please provide any additional information below. I do have libiconv in /usr/lib

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=8

_iconv not linked to binary

From afarnham on March 28, 2011 20:43:14

What steps will reproduce the problem? 1. Download pyspatialite 2.6.1
2. do "sudo python setup.py install"
3. In python interpreter run "from pyspatialite import dbapi2" What is the expected output? What do you see instead? Expected output is a new line.

I see the following error:

Python 2.7.1 ( r271 :86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

from pyspatialite import dbapi2
Traceback (most recent call last):
File "", line 1, in
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/dbapi2.py", line 27, in
from pyspatialite._spatialite import *
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so, 2): Symbol not found: _iconv
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so
Expected in: flat namespace
in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyspatialite/_spatialite.so What version of the product are you using? On what operating system? I am using 2.6.1 on Mac OS X 10.6.7 Please provide any additional information below. I solved this for myself by adding 'iconv' to the libraries list in setup.py

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=2

Segmentation fault: 11

From ziade.tarek on May 30, 2013 03:56:30

on the latest release, on mac os x

If I try to load the extension from within SQLALchemy, I get a segfault

_EXT = '/usr/local/lib/libspatialite.dylib'

class SpatialiteConnectionListener(PoolListener):
def connect(self, dbapi_con, con_record):
#import pdb; pdb.set_trace()
dbapi_con.enable_load_extension(True)
dbapi_con.execute("select load_extension('%s')" % _EXT)
dbapi_con.enable_load_extension(False)

stracing it I can see it opens /usr/local/lib/libsqlite3.0.8.6.dylib
before crashing

is that a version issue ?

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=14

Build failing with error: command 'gcc' failed with exit status 1 / InstallationError

From kevin.dahl on February 26, 2012 17:19:46

What steps will reproduce the problem? 1. pip install pyspatialite

What is the expected output?

Successful package install

What do you see instead?

See attachment.

What version of the product are you using?

3.0.1
Python 2.7.2 64-Bit

On what operating system?

Windows 7 64-Bit Please provide any additional information below. I don't know if my lib paths for libgeos/libgeos_c/libproj are standard or not, I have them installed in C:\OSGeo4W via the standard OsGEO setup values.

I did notice that here: http://code.activestate.com/pypm/pyspatialite/ The ActiveState status for pyspatialite shows the build failing with fairly similar errors on 32/64-bit Linux, so it didn't seem like it would be the lib locations on Windows causing this specific error.

Attachment: pip.log

Original issue: http://code.google.com/p/pyspatialite/issues/detail?id=6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.