Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import sqlite3 not running after configure --prefix=/alt/path; make; make install #66149

Closed
alexganwd mannequin opened this issue Jul 10, 2014 · 16 comments
Closed

import sqlite3 not running after configure --prefix=/alt/path; make; make install #66149

alexganwd mannequin opened this issue Jul 10, 2014 · 16 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@alexganwd
Copy link
Mannequin

alexganwd mannequin commented Jul 10, 2014

BPO 21950
Nosy @brettcannon, @vstinner, @bitdancer, @berkerpeksag
Files
  • make.log: make.log
  • make_install.log
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-07-23.06:09:03.061>
    created_at = <Date 2014-07-10.10:00:36.260>
    labels = ['type-bug', 'library']
    title = 'import sqlite3 not running after configure --prefix=/alt/path; make; make install'
    updated_at = <Date 2018-07-23.06:09:03.059>
    user = 'https://bugs.python.org/alexganwd'

    bugs.python.org fields:

    activity = <Date 2018-07-23.06:09:03.059>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-23.06:09:03.061>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2014-07-10.10:00:36.260>
    creator = 'alexganwd'
    dependencies = []
    files = ['35920', '35989']
    hgrepos = []
    issue_num = 21950
    keywords = []
    message_count = 16.0
    messages = ['222656', '222657', '222659', '222668', '222670', '222733', '222734', '222736', '222737', '222744', '222745', '223356', '223400', '223415', '223416', '322179']
    nosy_count = 7.0
    nosy_names = ['brett.cannon', 'vstinner', 'donmez', 'r.david.murray', 'berker.peksag', 'alexganwd', 'dpatino']
    pr_nums = []
    priority = 'normal'
    resolution = 'works for me'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21950'
    versions = ['Python 3.4']

    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 10, 2014

    We have compile python 3.4.1 in Suse Linux Enterprise Server 11 SP2

    We have compiled it using --prefix as args :

    ./configure --prefix=/soft/pyt341

    make

    make install

    We check python has been properly installed:

    /soft/pyt341/bin/python3 --version
    Python 3.4.1

    We try to import sqlite3 lib and we get this error:

    /soft/pyt341/bin/python3 -c "import sqlite3"

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/soft/pyt341/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
        from sqlite3.dbapi2 import *
      File "/soft/pyt341/lib/python3.4/sqlite3/dbapi2.py", line 26, in <module>
        from _sqlite3 import *
    ImportError: No module named '_sqlite3'

    @alexganwd alexganwd mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Jul 10, 2014
    @berkerpeksag
    Copy link
    Member

    We have compiled it using --prefix as args :

    Did you install sqlite3-devel?

    @berkerpeksag berkerpeksag removed the type-crash A hard crash of the interpreter, possibly with a core dump label Jul 10, 2014
    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 10, 2014

    Yes. We have these packages installed:

    rpm -qa | grep sqlite
    sqlite3-3.7.6.3-1.4.4.1
    libsqlite3-0-3.7.6.3-1.4.4.1
    sqlite3-devel-3.7.6.3-1.4.4.1

    @brettcannon
    Copy link
    Member

    The output from running make could help by pointing out either a compilation error or lack thereof to deduce that setup.py did not find the headers.

    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 10, 2014

    Here you have (attached): make.log
    Thanks!

    @dpatino
    Copy link
    Mannequin

    dpatino mannequin commented Jul 11, 2014

    Hi, I've the same problem.
    I've already tested (from source, Python-3.4.1.tgz) under OpenSUSE 12.3 and Debian 7.5 with the same issue. I've compiled it in standard way (./configure; make; make install) although the output (error) is the same, after import sqlite3:

    #python3 -c "import sqlite3"

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

    However, if I install it using specific distro packages it works properly.

    @berkerpeksag
    Copy link
    Member

    Works for me on Ubuntu 12.04 LTS:

       $ sudo apt-get install sqlite3 libsqlite3-dev
       $ ./configure
       $ make -j3
       $ sudo make install
       $ sqlite3 -version
       3.7.9 2011-11-01 00:52:41 c7c6050ef060877ebe77b41d959e9df13f8c9b5e
       $ python3.4 -V
       3.4.1
       $ python3.4 -c "import sqlite3; print(sqlite3.sqlite_version)"
       3.7.9

    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 11, 2014

    I've downloaded UBUNTU 12.04. I've compiled python3 and I got the same error.

    Seleccionando el paquete sqlite3 previamente no seleccionado.
    Desempaquetando sqlite3 (de .../sqlite3_3.7.9-2ubuntu1.1_i386.deb) ...
    Procesando disparadores para man-db ...
    Configurando libsqlite3-dev (3.7.9-2ubuntu1.1) ...
    Configurando sqlite3 (3.7.9-2ubuntu1.1) ...
    ubuntu@ubuntu:~$ python3.4 -c "import sqlite3"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
        from sqlite3.dbapi2 import *
      File "/usr/local/lib/python3.4/sqlite3/dbapi2.py", line 26, in <module>
        from _sqlite3 import *
    ImportError: No module named '_sqlite3'

    @donmez
    Copy link
    Mannequin

    donmez mannequin commented Jul 11, 2014

    Chiming in here as a SUSE guy;

    Can you make sure

    /usr/local/lib/python3.4/lib-dynload/_sqlite3.cpython-34m.so

    does exist. If yes run ldd on it

    ldd /usr/local/lib/python3.4/lib-dynload/_sqlite3.cpython-34m.so

    And also give output of "which python3.4" to make sure you are running the right python instance.

    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 11, 2014

    we have /usr/local/lib/python3.4/lib-dynload/_sqlite3.cpython-34m.so but we didn't have it in /soft/pyt341/lib/python3.4/lib-dynload/

    After copying it into /sofy/pyt341.... the problem was solved!! ;)

    /soft/pyt341/bin/python3 -c "import sqlite3;print(sqlite3.sqlite_version)"
    3.7.6.3

    In my opinion running ./configure should check if sqlite libs are properly satisfied and break compilation if they aren't installed.
    :)

    I don't know if this issue could be considered a bug. So I will close it as "works for me"

    Thanks for all!

    @alexganwd alexganwd mannequin closed this as completed Jul 11, 2014
    @dpatino
    Copy link
    Mannequin

    dpatino mannequin commented Jul 11, 2014

    You're absolute right that file is not in path.
    However, in my view this a bug, due to the fact libsqlite3-dev package must be installed before Python3.4.1 is compiled (or install it and recompile python) because there is no errors, no warnings... nothing.

    In any case, thanks a lot for your help. This solution works for me.

    @bitdancer
    Copy link
    Member

    If the headers are missing, you will get a complaint at the end of the make process that it couldn't build the _sqlite module. It should also have tried to import the sqlite3 module and complained if there was an error. So, pre-install, everything looked fine to the build process.

    Can you attach your 'make install' log?

    (Berker: a key difference in your test is that OP specified an alternate --prefix)

    @bitdancer bitdancer reopened this Jul 17, 2014
    @bitdancer bitdancer changed the title import sqlite3 not running import sqlite3 not running after configure --prefix=/alt/path; make; make install Jul 17, 2014
    @alexganwd
    Copy link
    Mannequin Author

    alexganwd mannequin commented Jul 18, 2014

    Here you have make_install.log

    Thanks

    @bitdancer
    Copy link
    Member

    The install log shows the file being copied into place:

    copying build/lib.linux-x86_64-3.4/_sqlite3.cpython-34m.so -> /soft/pyt341/lib/python3.4/lib-dynload

    This does not line up with the fact that you said the file did not exist after the install. Something would have to be deleting the file after it got copied into place. After you run make install, is there anything at all in lib-dynload?

    @bitdancer
    Copy link
    Member

    configure with a prefix followed by make/make install works fine for me, by the way (on a Gentoo system).

    @berkerpeksag
    Copy link
    Member

    Closing this for now since we couldn't reproduce the problem and haven't heard back from the OP in a while.

    @berkerpeksag berkerpeksag added the type-bug An unexpected behavior, bug, or error label Jul 23, 2018
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants