我试图直接从源代码构建Python,没有管理员权限,并且在运行后:
出口CPPFLAGS ='-I / opt / sqlite-3.7.16.2 / include -I / opt / tk8.6.0 / include
-I / opt / tcl8.6.0 / include /'export LDFLAGS ='-L / opt / sqlite-3.7.16.2 / lib -L / opt / tk8.6.0 / lib /
-L / opt / tcl8.6.0 / lib / ./configure --prefix = / path_to_python-2.7.4 --enable-shared'
然后
make
我得到以下内容:
建立'_tkinter'扩展名
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict原型-DWITH_APPINIT = 1 -I / usr / X11 / include -I。 -IInclude -I./Include -I / opt / sqlite / sqlite-3.7.16.2 / include -I / opt / tk8.6.0 / include -I / opt / tcl8.6.0 / include -I / usr / local / include- I / opt / python / src / Python-2.7.4 / include -I / opt / python / src / Python-2.7.4 -c /opt/python/src/Python-2.7.4/Modules/_tkinter.c- o build / temp.linux-x86_64-2.7 / opt / python / src / Python-2.7.4 / Modules / _tkinter.o
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict原型-DWITH_APPINIT = 1 -I / usr / X11 / include -I。 -IInclude -I./Include -I / opt / sqlite / sqlite-3.7.16.2 / include -I / opt / tk8.6.0 / include -I / opt / tcl8.6.0 / include -I / usr / local / include- I / opt / python / src / Python-2.7.4 / include -I / opt / python / src / Python-2.7.4 -c /opt/python/src/Python-2.7.4/Modules/tkappinit.c- o build / temp.linux-x86_64-2.7 / opt / python / src / Python-2.7.4 / Modules / tkappinit.o
gcc -pthread -shared -L / opt / sqlite / sqlite-3.7.16.2 / lib -L / opt / tk8.6.0 / lib / -L / opt / tcl8.6.0 / lib / -L / opt / sqlite / sqlite- 3.7.16.2/lib -L / opt / tk8.6.0 / lib / -L / opt / tcl8.6.0 / lib / -I。 -IInclude -I./Include -I / opt / sqlite / sqlite-3.7.16.2 / include -I / opt / tk8.6.0 / include -I / opt / tcl8.6.0 / include build / temp.linux-x86_64-2.7 /opt/python/src/Python-2.7.4/Modules/_tkinter.o build / temp.linux-x86_64-2.7 / opt / python / src / Python-2.7.4 / Modules / tkappinit.o -L / usr / X11 / lib -L / opt / sqlite / sqlite-3.7.16.2 / lib -L / opt / tk8.6.0 / lib / -L / opt / tcl8.6.0 / lib / -L / usr / local / lib -L。 -ltk8.6 -ltcl8.6 -lX11 -lpython2.7 -o build / lib.linux-x86_64-2.7 / _tkinter.so
*警告:由于导入“ _tkinter”失败,因此重命名失败:libtk8.6.so:无法打开共享库文件:没有此类文件或目录
奇怪的是,我可以看到libtk8.6.so
。 正如我用LDFLAGS
指定的那样,它实际上就在/opt/tcl8.6.0/lib
下。
为什么编译失败?