I tried to install django on ubuntu using pip. but unfortunately I got error like this. can someone explain this and tell me some ways to fix this?
error: could not create '/usr/local/lib/python2.7/dist-packages/django': Permission denied
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/home/franklingu/build/django /setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W5MhGe-record/install-record.txt failed with error code 1
Storing complete log in /home/franklingu/.pip/pip.log
Don't use sudo use a virtual environment instead, like this:
$ sudo apt-get install python-virtualenv
$ mkvirtualenv django_env
$ source django_env/bin/activate
(django_env) $ pip install django
(django_env) $ cd $HOME
(django_env) $ mkdir projects
(django_env) $ cd projects
(django_env)/projects $ django-admin.py startproject foo
(django_env)/projects $ cd foo
(django_env)/projects/foo $ python manage.py runserver
When you are finished; type deactivate
to exit the virtual environment:
(django_env)/projects/foo $ deactivate
/projects/foo $
Try sudo pip install django
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With