Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82544

Re: How to import sqlite3 in my python3.4 successfully?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.python
Subject Re: How to import sqlite3 in my python3.4 successfully?
Date Mon, 15 Dec 2014 05:06:49 +0100
Organization PointedEars Software (PES)
Lines 92
Message-ID <5855432.1dnEEsJeUy@PointedEars.de> (permalink)
References <mailman.16948.1418569618.18130.python-list@python.org>
Reply-To Thomas 'PointedEars' Lahn <usenet@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Trace solani.org 1418616410 22513 eJwFwYEBwDAEBMCVeLxmHCT2H6F3YVROOoMeG6tYYo91Qk5VUOVxCoFF6yuxp807DWpe/34S1RDn (15 Dec 2014 04:06:50 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Mon, 15 Dec 2014 04:06:50 +0000 (UTC)
User-Agent KNode/4.14.2
X-User-ID eJwFwYEBACAEBMCVUh6N88j+I3SHY2LlajDFYKSwXrcwpk0jO9KmyYOtrrSMIFLW5Q1eqezHcsRLboH7B3ZXFlI=
Cancel-Lock sha1:NhRVeIDDO1SGhJnczI6TNuM3gYk=
X-NNTP-Posting-Host eJwNwoERACEIA7CZRCk4Di3P/iO8l/jGguLAcXyerKuhYtmnmjD2ZvdyvOOlG0VZJ7LIzB86GhIn
Xref csiph.com comp.lang.python:82544

Show key headers only | View raw


sir wrote:
^^^
Please fix.

> There are two python version in my debian7, one is python2.7 the system
> default version, the other is python3.4 which compiled to install this
> way.
> 
> |  apt-get  update
>   apt-get  upgrade
>   apt-get  install build-essential
>   wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
>   tar-zxvfPython-3.4.0.tgz
>   cdPython-3.4.0
>   mkdir/usr/local/python3.4
>   ./configure--prefix=/usr/local/python3.4
>   make
>   make install
>   ln-s/usr/local/python3.4/bin/python3.4    /usr/bin/python3.4
>   ln-s/usr/local/python3.4/bin/pip3.4    /usr/bin/pip3.4|

Why do you not use the Debian packages instead?

> I have installed sqlite this way on my debian.
> 
> |sudo apt-get  install sqlite3 libsqlite3-dev|

That package has nothing to do with Python:

$ dpkg -L libsqlite3-dev
/.
/usr
/usr/include
/usr/include/sqlite3.h
/usr/include/sqlite3ext.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libsqlite3.a
/usr/lib/x86_64-linux-gnu/libsqlite3.la
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/sqlite3.pc
/usr/share
/usr/share/doc
/usr/share/doc/libsqlite3-dev
/usr/share/doc/libsqlite3-dev/changelog.Debian.gz
/usr/share/doc/libsqlite3-dev/changelog.gz
/usr/share/doc/libsqlite3-dev/changelog.html.gz
/usr/share/doc/libsqlite3-dev/copyright
/usr/lib/x86_64-linux-gnu/libsqlite3.so

> In python3.4
> 
> |root@rebuild:~#  python3.4
> Python  3.4.0  (default,  Nov  27  2014,  13:54:17)
> [GCC4.7.2]  on linux
> Type  "help",  "copyright",  "credits"  or  "license"  for  more
> information.
>>>>  import  sqlite3
> Traceback  (most recent calllast):
>    File  "<stdin>",  line1,  in  <module>
>    File  "/usr/local/python3.4/lib/python3.4/sqlite3/__init__.py", 
>    line23,  in  <module>
>      from  sqlite3.dbapi2import  *
>    File  "/usr/local/python3.4/lib/python3.4/sqlite3/dbapi2.py",  line26, 
>    in  <module>
>      from  _sqlite3import  *
> ImportError:  No  module  named'_sqlite3'|
> 
> How can i import sqlite3 in my python3.4 successfully?

Install the Debian packages.

,----
| # apt-file search dbapi2.py | grep python3
| libpython3.4-stdlib: /usr/lib/python3.4/sqlite3/dbapi2.py
| python3.2: /usr/lib/python3.2/sqlite3/dbapi2.py
`----

,----
| $ python3.4
| Python 3.4.2 (default, Dec  2 2014, 15:08:18) 
| [GCC 4.9.2] on linux
| Type "help", "copyright", "credits" or "license" for more information.
| >>> import sqlite3
| >>> 
`----

-- 
PointedEars

Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

How to import sqlite3 in my python3.4 successfully? sir <elearn2014@gmail.com> - 2014-12-14 23:06 +0800
  Re: How to import sqlite3 in my python3.4 successfully? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-12-15 05:06 +0100

csiph-web