温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Python软件管理工具pip的安装过程是怎样的

发布时间:2021-10-11 18:27:36 来源:亿速云 阅读:131 作者:柒染 栏目:MySQL数据库

这期内容当中小编将会给大家带来有关Python软件管理工具pip的安装过程是怎样的,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。

    因为项目的原因我需要深入的学习python,后端程序依赖各种各种软件包,比如MySQLdb,新手可能会有些不熟悉 如何快速安装所需要的python 包。常用的python 包安装和管理有 easy_install, setuptools, pip,distribute。
本文则介绍pip---“A tool for installing and managing Python packages.“
安装pip
先要获取脚本 get-pip.py  

  1. wget  https://bootstrap.pypa.io/get-pip.py

  2. python get-pip.py

注意: 
get-pip.py 会帮你安装setuptools,如果你已经安装了,则会运行升级命令:

  1. pip install -U setuptools

升级pip

  1. pip install -U pip

安装python 包

  1. pip install SomePackage        # 不指定版本 则下载最新版本

  2. pip install SomePackage==1.0.4     # 下载指定版本

例如 下载安装 MySQLdb

  1. root@rac3:~/scripts# >pip install MySQL-python

  2. Collecting MySQL-python

  3. /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.

  4.   SNIMissingWarning

  5. /usr/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

  6.   InsecurePlatformWarning

  7.   Downloading MySQL-python-1.2.5.zip (108kB)

  8.     100% |████████████████████████████████| 110kB 354kB/s

  9. Building wheels for collected packages: MySQL-python

  10.   Running setup.py bdist_wheel for MySQL-python ... done

  11.   Stored in directory: /root/.cache/pip/wheels/8c/0d/11/d654cad764b92636ce047897dd2b9e1b0cd76c22f813c5851a

  12. Successfully built MySQL-python

  13. Installing collected packages: MySQL-python

  14. Successfully installed MySQL-python-1.2.5

上述就是小编为大家分享的Python软件管理工具pip的安装过程是怎样的了,如果刚好有类似的疑惑,不妨参照上述分析进行理解。如果想知道更多相关知识,欢迎关注亿速云行业资讯频道。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI