Trouble installing Django

612 views
Skip to first unread message

Phil Campaigne

unread,
Sep 3, 2018, 1:39:25 PM9/3/18
to Django users
I have successfully installed python 3.7 and virtualenv. on my MACBook Pro with MAC High Sierra  10.6
Now I am having trouble installing Django
I don't understand the error message I am getting...especially teh last line.

Owners-MacBook-Pro:realityBB owner$ pip install Django
Collecting Django
Downloading https://files.pythonhosted.org/packages/f8/1c/31112c778b7a56ce18e3fff5e8915719fbe1cd3476c1eef557dddacfac8b/Django-1.11.15-py2.py3-none-any.whl (6.9MB)
100% |████████████████████████████████| 7.0MB 2.2MB/s
Requirement already satisfied: pytz in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from Django) (2013.7)
Installing collected packages: Django
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/Django-1.11.15.dist-info'
Consider using the `--user` option or check the permissions.

Julio Biason

unread,
Sep 3, 2018, 1:45:10 PM9/3/18
to django...@googlegroups.com
Hi Phil,

This happens because you're trying to install Django system-wide and that operation requires root (superuser) access.

The best way to install Django is to first create a virtualenv. That will isolate the install directory from the system, so you can freely install and uninstall any libraries without interfering with the system.

You can find more information here: https://docs.python.org/3/library/venv.html

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2d82fa91-1cd0-4a16-9ebd-568e7aeb8b2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Julio Biason, Sofware Engineer
AZION  |  Deliver. Accelerate. Protect.
Office: +55 51 3083 8101  |  Mobile: +55 51 99907 0554

TimT Vogt

unread,
Sep 3, 2018, 2:08:51 PM9/3/18
to django...@googlegroups.com
Use pip3 install django==2.01
You can use python 2.7 and python3
I use pip3 for installation of Django in python 3


Verstuurd vanaf mijn iPhone
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

Iga John Bosco

unread,
Sep 3, 2018, 2:25:33 PM9/3/18
to Django users
U have installed python 3 but ure django installation is pick a different version of python.

Simple. My experience is Linux or Ubuntu based.
First get the path to ure python3
#Which python
Or
# python -c “from dilutions.sysconfig import get_get_python_lib; print get_python_li

Then

Do a pip install django specifying the version of python from the path generated by which python

Pip install django -p /usr/bin/python3.7

Devender Kumar

unread,
Sep 4, 2018, 3:20:40 AM9/4/18
to django...@googlegroups.com
If you wanna install across the system then just Use root user Or sudo pip install Django . this is install the django in your system.
but Best practices is to use special env If you need any help installing django with env reply me i will help in that.
Thanks enjoy
Dev

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

PASCUAL Eric

unread,
Sep 4, 2018, 3:43:27 AM9/4/18
to Django users

Hi Phil,


As suggested by other posters, creating a virtualenv is the safest way to work with Python, since it avoids tampering with the system level installation (f.i. several Linux distros use Python for a lot of their system tools in nowadays versions) and it lets you have customized environments per project (or projects group) not interfering with other ones.


A solution exists one step higher, which allows you to have several different versions of Python (not only 2 and 3, but 2.x, 2.y, 3.z,...) alongside and select which one a given project uses. It's name is pyenv, and it can be found here : https://github.com/pyenv/pyenv


In addition to managing different versions of Python on the same system, you can also create virtualenvs attached to them, as you would do with a standard Python installation.


And of course, everything runs  in user space, so no need for sudo or admin rights. Plus some goodies such as automatically selecting the right pyenv (i.e. Python version plus virtualenv) when you cd to a directory, if a ".python-version" file containing its name exists in it or in one of its ancestors. Have a look to the Web page referenced above for more detail.


I work on various projects targeting systems or Docker containers with different Python versions, and the pyenv+virtualenv way is the easiest and most comfortable I've ever used.

Best.

Eric


From: django...@googlegroups.com <django...@googlegroups.com> on behalf of Phil Campaigne <philca...@gmail.com>
Sent: Monday, September 3, 2018 7:35:09 PM
To: Django users
Subject: Trouble installing Django
 
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
Reply all
Reply to author
Forward
0 new messages