Skip to content Skip to sidebar Skip to footer

Cannot Install Django 2 Beta 1 On Ubuntu Server 16.04

I'm trying to install Django 2 beta 1 on an Ubuntu Server 16.04 using the command line shown on Django's download page without success. The given command line is: pip install --pre

Solution 1:

Write explicit the version of Django you want to install:

pip install --pre Django==2.0b1

The option --pre (prerelease) can be also left out.

EDIT (after comment):

This definitely works as I have tried it. To list all versions of a package I use a dirty solution like:

pip install django==0

As pip can't find this nonexisting version it returns a list with all available versions (from versions: ...). The last version there is 2.0b1.

EDIT:

I strongly assume you're using Python 2. That would explain why the installation fails. If you want to try out Django 2, you'll need Python 3. This is what the official documentation says:

Django 2.0 supports Python 3.4, 3.5, and 3.6. We highly recommend and only officially support the latest release of each series.

Using virtual environments installing Django 2.0 could look like this:

  1. Install virtualenv (check this here).

  2. Create new virtual environment called djangobeta with python3. Execute the following command in the shell:

    virtualenv -p python3 djangobeta

  3. Install Django 2.0 beta 1:

    pip install --pre django

Solution 2:

I found a solution: I uninstalled every version of Python I had (2.7, 3.5, 3.6) as well as Pip.

Then installed only Python 3.5 and installed Pip via a python script retrieved by Curl (had to do this way otherwise apt was installing Python 2.7 along with Pip) with these commands:

curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python3 get-pip.py

Finally, I installed the Django 2 beta1 with the original command:

pip install --pre Django

Post a Comment for "Cannot Install Django 2 Beta 1 On Ubuntu Server 16.04"