问题描述:
在安装 pyenv 安装完 python 的时候, 用 pip 安装 django 提示没有这个命令
- [root@zabbix ~]# pip install django== 2.0
- pyenv: pip: command not found
- The `pip' command exists in these Python versions:
- 3.6.2
如果没有从 python.org 提供的二进制文件中安装 pyenv, 则需要单独安装 pip
安装完所需的 python 版本后, 下载并安装 pip:
使用 get-pip.py 进行安装
要安装 pip, 请安全下载 get-pip.py:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
或者: wget https://bootstrap.pypa.io/get-pip.py
然后运行以下命令:
python get-pip.py
警告: 如果您使用的是由操作系统或其他程序包管理器管理的 Python 安装, 请务必小心. get-pip.py 不与这些工具协调, 可能会使系统处于不一致状态.
除了使用 pip 安装 python 还可以用 Git clone
Git clone https://github.com/django/django.git
升级 PIP
在 Linux 或 macOS 上:
- [root@zabbix ~]# pip install -U pip
- Requirement already up-to-date: pip in /usr/lib/python2.7/site-packages (18.1)
在 Windows 上:
python -m pip install -U pip
pip 安装文档: https://pip.pypa.io/en/latest/installing/
django 安装方法: https://www.djangoproject.com/download/
来源: http://www.bubuko.com/infodetail-2865412.html