Python升级和安装pip
参考:http://ruter.sundaystart.net/2015/12/03/Update-python/
最后一步make install 用 make altinstall
http://stackoverflow.com/questions/10624511/upgrade-python-without-breaking-yum
这里的例子是升级到2.7,其实升级到其他版本方法也是一样的。只是下载的源码包变了而已
比如需要安装python3.5则把wget链接改一下就可以了
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tar.xz
python的所有代码包,都在下方链接可以看到
https://www.python.org/ftp/python/
windows安装python,如果没有vpn的话,下载很慢,直接360软件管理搜索就可以找到64位的,非常快,只是注意一点,需要把下方的勾选上,否则需要手动添加环境变量
使用pip安装python模块
python安装模块的时候,可以先用这个命令搜索下列表pip search xx
[root@fengniu020 web]# pip search toml
toml.py (0.1.7) - Tested Toml's Python implementation. An
improved version of marksteve/toml-ply with friendly
support for unicode, raw and common strings.
pytoml (0.1.11) - A parser for TOML-0.4.0
INSTALLED: 0.1.11 (latest)
settei (0.2.0) - Configuration loader from a TOML file
subtoml (0.1.0) - Sed for TOML: subtitute parts of a TOML file
montague_toml (0.2.0) - Montague provides functions to load WSGI apps and
servers based on configuration files. montague_toml
loads configuration from TOML markup files.
contoml (0.32) - Consistent TOML for Python
libtoml (1.0) - A Python toml parser.
toml-python (0.4.1) - TOML parser for python.
customlogging (0.1.10) - A set of custom logging wrappers and functions.
toml (0.9.2) - Python Library for Tom's Obvious, Minimal Language
toml-ply (0.0.5) - TOML PLY parser
PloneFolderContentsTopBottomLinks (2.0) - Patch folder contents to show top and bottom links
(Plone 4 compatible release)
prettytoml (0.3) - TOML Prettifier for Python
为什么要这么做呢?因为有的时候直接pip install xx是找不到模块的,比如下方这个
ImportError: No module named tomlpython
如果直接安装,是不行的。因为实际安装包既然是toml-python
pip install tomlpython
所以正确的安装方式是
pip install toml-python