我在CentOS上安装了python3.5.1
这是我看到的安装结束
/bin/install -c -m 644 ./Include/weakrefobject.h /usr/local/include/python3.5m
/bin/install -c -m 644 pyconfig.h /usr/local/include/python3.5m/pyconfig.h
/bin/install -c -m 644 Modules/config.c /usr/local/lib/python3.5/config-3.5m/config.c
/bin/install -c -m 644 Programs/python.o /usr/local/lib/python3.5/config-3.5m/python.o
/bin/install -c -m 644 ./Modules/config.c.in /usr/local/lib/python3.5/config-3.5m/config.c.in
/bin/install -c -m 644 Makefile /usr/local/lib/python3.5/config-3.5m/Makefile
/bin/install -c -m 644 Modules/Setup /usr/local/lib/python3.5/config-3.5m/Setup
/bin/install -c -m 644 Modules/Setup.local /usr/local/lib/python3.5/config-3.5m/Setup.local
/bin/install -c -m 644 Modules/Setup.config /usr/local/lib/python3.5/config-3.5m/Setup.config
/bin/install -c -m 644 Misc/python.pc /usr/local/lib/pkgconfig/python-3.5.pc
/bin/install -c ./Modules/makesetup /usr/local/lib/python3.5/config-3.5m/makesetup
/bin/install -c ./install-sh /usr/local/lib/python3.5/config-3.5m/install-sh
/bin/install -c python-config.py /usr/local/lib/python3.5/config-3.5m/python-config.py
/bin/install -c python-config /usr/local/bin/python3.5m-config
./python -E ./setup.py install \
--prefix=/usr/local \
--install-scripts=/usr/local/bin \
--install-platlib=/usr/local/lib/python3.5/lib-dynload \
--root=/
running install
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
**Python build finished successfully!**
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
running build_scripts
copying and adjusting /home/kumar/Python-3.5.1/Tools/scripts/pydoc3 -> build/scripts-3.5
copying and adjusting /home/kumar/Python-3.5.1/Tools/scripts/idle3 -> build/scripts-3.5
copying and adjusting /home/kumar/Python-3.5.1/Tools/scripts/2to3 -> build/scripts-3.5
copying and adjusting /home/kumar/Python-3.5.1/Tools/scripts/pyvenv -> build/scripts-3.5
changing mode of build/scripts-3.5/pydoc3 from 644 to 755
changing mode of build/scripts-3.5/idle3 from 644 to 755
changing mode of build/scripts-3.5/2to3 from 644 to 755
changing mode of build/scripts-3.5/pyvenv from 644 to 755
renaming build/scripts-3.5/pydoc3 to build/scripts-3.5/pydoc3.5
renaming build/scripts-3.5/idle3 to build/scripts-3.5/idle3.5
renaming build/scripts-3.5/2to3 to build/scripts-3.5/2to3-3.5
renaming build/scripts-3.5/pyvenv to build/scripts-3.5/pyvenv-3.5
running install_lib
copying build/lib.linux-x86_64-3.5/_sysconfigdata.py -> /usr/local/lib/python3.5/lib-dynload
creating /usr/local/lib/python3.5/lib-dynload/__pycache__
copying build/lib.linux-x86_64-3.5/__pycache__/_sysconfigdata.cpython-35.pyc -> /usr/local/lib/python3.5/lib-dynloa
d/__pycache__
copying build/lib.linux-x86_64-3.5/__pycache__/_sysconfigdata.cpython-35.opt-1.pyc -> /usr/local/lib/python3.5/lib-
dynload/__pycache__
copying build/lib.linux-x86_64-3.5/__pycache__/_sysconfigdata.cpython-35.opt-2.pyc -> /usr/local/lib/python3.5/lib-
dynload/__pycache__
changing mode of /usr/local/lib/python3.5/lib-dynload/_sysconfigdata.py to 644
更多行说明改变模式然后到最后这个
changing mode of /usr/local/lib/python3.5/lib-dynload/_codecs_iso2022.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/_decimal.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/_multiprocessing.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/ossaudiodev.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/xxlimited.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/_ctypes.cpython-35m-x86_64-linux-gnu.so to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/ to 755
changing mode of /usr/local/lib/python3.5/lib-dynload/__pycache__ to 755
running install_scripts
copying build/scripts-3.5/pydoc3.5 -> /usr/local/bin
copying build/scripts-3.5/idle3.5 -> /usr/local/bin
copying build/scripts-3.5/2to3-3.5 -> /usr/local/bin
copying build/scripts-3.5/pyvenv-3.5 -> /usr/local/bin
changing mode of /usr/local/bin/pydoc3.5 to 755
changing mode of /usr/local/bin/idle3.5 to 755
changing mode of /usr/local/bin/2to3-3.5 to 755
changing mode of /usr/local/bin/pyvenv-3.5 to 755
rm /usr/local/lib/python3.5/lib-dynload/_sysconfigdata.py
rm -r /usr/local/lib/python3.5/lib-dynload/__pycache__
/bin/install -c -m 644 ./Misc/python.man \
/usr/local/share/man/man1/python3.5.1
if test "xupgrade" != "xno" ; then \
case upgrade in \
upgrade) ensurepip="--altinstall --upgrade" ;; \
install|*) ensurepip="--altinstall" ;; \
esac; \
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Ignoring ensurepip failure: pip 7.1.2 requires SSL/TLS
据我所知,python已成功安装
但是,当我说#python3或#python3.5或#python3.5.1(来自root)时,它只是说
-bash: python3.5: command not found
我没有修改安装路径或安装在/usr/local ...上的任何内容。请参阅附件。
我按照https://www.digitalocean.com/community/tutorials/how-to-set-up-python-2-7-6-and-3-3-3-on-centos-6-4
上的说明操作并运行了命令
$make altinstall
我应该跑步吗?
$make && make altinstall
***更新**** 我按照@intboolstring的推荐尝试了#make install而不是#make altinstall,这是输出,你会看到其中一个屏幕截图是“Python build finished successfully”,但在此之后我运行python3没有运气
答案 0 :(得分:1)
嗯,这是因为python3.5
命令不存在。
python
将使用
运行Python 2python3
运行Python 3 shell。
当你启动python shell时,会说:
$ python3
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 23 2015, 02:52:03)
显示您的版本号。