简体   繁体   English

本地安装python

[英]Local installation of python

I want to install python to my local direcotory: 我想将python安装到我的本地目录中:

./configure --prefix=/home/alex/local-install && make && make install

When i import sqlite3 i get the following: 当我导入sqlite3时,我得到以下信息:

ImportError: No module named _sqlite3

the reason: there is no _sqlite3.so in /home/alex/local-install/lib/python2.6/lib-dynload. 原因:/home/alex/local-install/lib/python2.6/lib-dynload中没有_sqlite3.so。

How can i force python to build bindings for sqlite and other libraries (zlib for example)? 如何强制python为sqlite和其他库(例如zlib)建立绑定?

PS By the way: if i install sqlite3 to my local directory /home/alex/local-install before installing python - import sqlite3 works fine. PS顺便说一句:如果我在安装python之前将sqlite3安装到我的本地目录/ home / alex / local-install-导入sqlite3可以正常工作。 That could be a solution: but in that case i have to install manually lots of libraries those i want to bind with python. 那可能是一个解决方案:但是在那种情况下,我必须手动安装很多我想与python绑定的库。 Brrrrr :-[ Brrrrr:-[

You need to install the development headers and libraries for sqlite somewhere where the Python build can find them. 您需要在Python构建可以找到它们的地方安装sqlite的开发标头和库。 You didn't say what OS you have. 您没有说您拥有什么操作系统。 On Linux you usually have to install additional -dev[el] packages to be able to build against a library. 在Linux上,通常必须安装其他-dev [el]软件包才能针对库进行构建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM