就会显示出python的新版本信息 view sourceprint? Python 2.7.3 (default, Sep 29 2013, 11:05:02) [GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
2.运行程序时出现错误: File "~/PythonInstall/lib/python2.7/multiprocessing/process.py", line 129, in start from .forking import Popen File "~/PythonInstall/lib/python2.7/multiprocessing/forking.py", line 58, in <module> from pickle import Pickler File "~/PythonInstall/lib/python2.7/pickle.py", line 1266, in <module> import binascii as _binascii ImportError: No module named binascii 是因为升级python版本不正常导致的。 回到源文件目录: # cd .../Python-2.7.3 [Python-2.7.3]# make -s building dbm using gdbm /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_set_result‘: /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: ‘sqlite3_int64‘ undeclared
(first use in this function) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: (Each undeclared identifier is
reported only once /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: for each function it appears in.) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: expected ‘)‘ before
‘PyInt_AsLong‘ /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_build_py_params‘: /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:583: error: ‘sqlite3_int64‘ undeclared (first use in this function) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:583: error: expected ‘;‘ before ‘val_int‘ /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:596: error: ‘val_int‘ undeclared (first use in
this function) /usr/bin/ld: /usr/local/lib/libz.a(adler32.o): relocation R_X86_64_32 against `a local symbol‘ can not be used when
making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status /usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol‘ can not be used when
making a shared object; recompile with -fPIC /usr/local/lib/libz.a: could not read symbols: Bad value collect2: ld returned 1 exit status
Python build finished, but the necessary bits to build these modules were not found: _tkinter bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module‘s name.
Failed to build these modules: _sqlite3 binascii zlib ? 升级安装zlib # wget http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.gz # tar -zxvf zlib-1.2.8.tar.gz # cd zlib-1.2.8 # ./configure # make install
# cd ../Python-2.7.3 # make -s building dbm using gdbm /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_set_result‘: /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: ‘sqlite3_int64‘ undeclared
(first use in this function) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: (Each undeclared identifier is reported
only once /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: for each function it appears in.) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:552: error: expected ‘)‘ before
‘PyInt_AsLong‘ /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c: In function ‘_pysqlite_build_py_params‘: /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:583: error: ‘sqlite3_int64‘ undeclared
(first use in this function) /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:583: error: expected ‘;‘ before ‘val_int‘ /opt/PJT_python/python-2.7.3/Python-2.7.3/Modules/_sqlite/connection.c:596: error: ‘val_int‘ undeclared (first use in
this function)
Python build finished, but the necessary bits to build these modules were not found: _tkinter bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module‘s name.
Failed to build these modules: _sqlite3
升级安装sqlite3 # cd .. # wget http://www.sqlite.org/2014/sqlite-autoconf-3080500.tar.gz # tar -zxvf sqlite-autoconf-3080500.tar.gz # cd sqlite-autoconf-3080500 # ./configure # make # make install
# cd .. # cd python-2.7.3 # make -s building dbm using gdbm
Python build finished, but the necessary bits to build these modules were not found: _tkinter bsddb185 dl imageop sunaudiodev To find the necessary bits, look in setup.py in detect_modules() for the module‘s name.