How to upgrade Django to 2.0 version [duplicate]

2019-08-26 12:17发布

This question already has an answer here:

I've been traying to upgrade my django versión and I've coudnt.

xxx@yyyyyy:~# python
Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.VERSION
(1, 11, 10, u'final', 0)

xxxx@yyyyyyy:~# pip install -U Django 
The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: Django in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: pytz in /usr/local/lib/python2.7/dist-packages (from Django)

xxxx@yyyyyy:~# pip --no-cache-dir install -U Django
Requirement already up-to-date: Django in /usr/local/lib/python2.7/dist-packages
Requirement already up-to-date: pytz in /usr/local/lib/python2.7/dist-packages (from Django)

How it coud be up-to-date my django version if enter code hereit is not 2.0 it is (1, 11, 10, u'final', 0)

And If I do an ls -s to know the files owners:

xxxx@yyyyyyy:~# ls -s /home/gechichure/.cache/pip
total 12
4 http  4 selfcheck.json  4 wheels

Not root or my useradmin ?!?!?! I do not understand how django it works and how pip it really works :(

I need to upgrade to 2.0 versión !!

Please any suggestions would be apprecciate.

Regards !!!

1条回答
Melony?
2楼-- · 2019-08-26 12:47

Django 2.0 isn't available for Python 2.7, so you should install Python 3 to work with it. I recommend making a virtualenv to don't have problem with the instalation.

Follow this steps and you will success :) https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-Python-s-virtualenv-using-Python-3

查看更多
登录 后发表回答