pip install Django on python3.6

后端 未结 5 2280
青春惊慌失措
青春惊慌失措 2021-02-19 19:35

If I run pip install Django I get

Requirement already satisfied: Django in /usr/local/lib/python2.7/dist-packages

I\'

相关标签:
5条回答
  • 2021-02-19 19:59

    If you have pip3 then directly use

    pip3 install Django

    Else try to use virtualenv for your python version as :

    pip -p python3.6 virtualenv name

    then you can install any version of Django on it.

    0 讨论(0)
  • 2021-02-19 20:00

    You can install it globally as others suggested, but the recommended way to install it is to use virtualenv or venv. In case you are using virtualenv (with virtualenvwrapper), just do

    mkvirtualenv --python="path to python3 executable" "environment name"
    pip install django
    

    Inside virtual environment pip would be pip3 by default and so is python.

    0 讨论(0)
  • 2021-02-19 20:06

    You have to install pip3 :

    sudo apt-get install python3-pip
    

    Then, you have to work with venv

    pip3 -p python3.6 virtualenv name
    

    And you have to write :

    pip3 install Django
    
    #or specific version
    pip3 install Django==1.10.5
    
    0 讨论(0)
  • 2021-02-19 20:06

    It means you already installed django in python2.7.

    You can install django for python3 via:

    pip3 install Django
    

    You can also activate virtualenv, and run pip install Django

    0 讨论(0)
  • 2021-02-19 20:14

    As is common with these sort of pip issues, before you install, check where pip is pointing to with pip -V.

    If that points to Python 2, you can then try pip3 -V; if that points to an older version of Python 3, go for pip3.6.

    As a final approach, you can always go through python itself with python3.6 -m pip install ...

    0 讨论(0)
提交回复
热议问题