Python3 pip |
您所在的位置:网站首页 › pip指向指定版本的python › Python3 pip |
Python3 pip
pip 是 Python 包管理工具,该工具提供了对 Python 包的查找、下载、安装、卸载的功能。 软件包也可以在 https://pypi.org/ 中找到。 目前最新的 Python 版本已经预装了 pip。 注意:Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具。 pip3安装方法一:先安装python3,python3安装好后,pip3默认安装 官网 方法二:手动下载安装指定版本 # 下载指定版本 wget https://pypi.python.org/packages/source/p/pip/pip-18.1.tar.gz # 解压 tar -zxvf pip-18.1.tar.gz # 安装 cd pip-18.1 python3 setup.py build python3 setup.py install # 添加到软连接 ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3 # 查看软连接 ll /usr/bin/pip*也就是说此方法都是二进制(源代码),但是我都去装了,都显示正确的信息,如1。但是无论是pip,还是pip3,还是pip -V,或者pip3 -V。都没反应,如同没装。不知道为何,记录一下,以后再试 为什么想要去用二进制装呢,因为我在制作docker的images,而apt install,需要先apt update,这样images会立刻增加200M。所以为了缩减,就想用二进制装一些必要的 现在有一个想法,是否需要建立软连接(ln s ),就如同二进制安装python时需要建立软连接。(20181019) 找到原因了,需要添加到环境里,第一种我有试了下,和之前返回成功信息一样,但这次信息里多了一些(我把默认改为python3.x) root@853e19c0f418:/# python -V Python 3.7.1rc2 root@853e19c0f418:/# python3 -V Python 3.7.1rc2 root@3547dc8d3d33:/# python get-pip.py Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting pip Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl (1.3MB) 100% |████████████████████████████████| 1.3MB 1.9MB/s Collecting wheel Downloading https://pypi.tuna.tsinghua.edu.cn/packages/fc/e9/05316a1eec70c2bfc1c823a259546475bd7636ba6d27ec80575da523bc34/wheel-0.32.1-py2.py3-none-any.whl Installing collected packages: pip, wheel Found existing installation: pip 10.0.1 Uninstalling pip-10.0.1: Successfully uninstalled pip-10.0.1 The script wheel is installed in '/usr/python/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-18.1 wheel-0.32.1 root@3547dc8d3d33:/# pip bash: pip: command not found root@3547dc8d3d33:/# pip3 bash: pip3: command not found root@3547dc8d3d33:/# pip list bash: pip: command not found 卸载PIP python3 -m pip uninstall pip注:如果安装了多个版本的pip,可执行多次卸载 重装PIP的命令:easy_inatall pip 升级PIP # 已验证 pip3 install --upgrade pip # 未验证 python -m pip install --upgrade pip注:默认是升级到最新版本 pip版本降级 python -m pip install pip==9.0.3 重装PIP的命令 easy_inatall pip pip和pip3有什么区别?如果同时装有python2和python3: pip默认给python2用。 pip3指定给python3用。 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |