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
Comments
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 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' |
Did you install sqlite3-devel? |
Yes. We have these packages installed: rpm -qa | grep sqlite |
The output from running |
Here you have (attached): make.log |
Hi, I've the same problem. #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. |
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 |
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' |
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. |
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)" 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! |
You're absolute right that file is not in path. In any case, thanks a lot for your help. This solution works for me. |
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) |
Here you have make_install.log Thanks |
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? |
configure with a prefix followed by make/make install works fine for me, by the way (on a Gentoo system). |
Closing this for now since we couldn't reproduce the problem and haven't heard back from the OP in a while. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: