Trouble installing py-sqlite3 port for python3.x

Modulok modulok at gmail.com
Sat Mar 31 20:00:48 UTC 2012


List,

I'm *guessing* this is more of FreeBSD problem than a python one, so I'll ask
on this list. I'm trying to import sqlite3 in python3.2 on FreeBSD
8.1-RELEASE and ran
into trouble:

    $ python3.2
    ...
    >>> import sqlite3
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.2/sqlite3/__init__.py", line 23, in <module>
        from sqlite3.dbapi2 import *
      File "/usr/local/lib/python3.2/sqlite3/dbapi2.py", line 26, in <module>
        from _sqlite3 import *
    ImportError: No module named _sqlite3


I assumed I was missing some operating system dependent sqlite3 package. When I
attempt to install the 'ports/databases/py-sqlite3' port, it worked but it
installed it for python2.6. (Importing sqlite3 works in 2.6) There are no
config options for this port to select a python version. Similarly there's no
sqlite3 related config options for the python3.2 port.

I then tried to use the python specific install tool, 'pip-3.2' to install the
python module:

    # pip-3.2 install pysqlite

Unfortunately, it fails:

    Downloading/unpacking pysqlite
      Real name of requirement pysqlite is pysqlite
      Downloading pysqlite-2.6.3.tar.gz (74Kb): 74Kb downloaded
      Running setup.py egg_info for package pysqlite
        Traceback (most recent call last):
          File "<string>", line 14, in <module>
          File "/usr/local/lib/python3.2/codecs.py", line 300, in decode
            (result, consumed) = self._buffer_decode(data, self.errors, final)
        UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 98:
        invalid continuation byte
        Complete output from command python setup.py egg_info:
        Traceback (most recent call last):

      File "<string>", line 14, in <module>

      File "/usr/local/lib/python3.2/codecs.py", line 300, in decode

        (result, consumed) = self._buffer_decode(data, self.errors, final)

    UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 98:
    invalid continuation byte

    ----------------------------------------
    Command python setup.py egg_info failed with error code 1
    Storing complete log in /root/.pip/pip.log

The complete log file doesn't reveal much else. My environment doesn't contain
any python env var. I don't have any python config files overriding install
locations or anything. My /etc/make.conf file contains no python variables. I
can display UTF-8 characters on the console just fine e.g:

    $ pytho3.2
    ...
    >>> chr(0xe4)
    'ä'

Suggestions, thoughts, ideas?


Thanks!
-Modulok-


More information about the freebsd-questions mailing list