1
votes

I was trying to install Django1.10 on my ubuntu 16.04 using pip install Django==1.10. Now I'm facing an error which I think is related to directories of installation path but I don't know how to get through. Here is the error:

  • Exception: Traceback (most recent call last): File "/home/atenagm/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main status = self.run(options, args) File "/home/atenagm/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run prefix=options.prefix_path, File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install **kwargs File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files isolated=self.isolated, File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files clobber(source, lib_dir, True) File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber ensure_dir(destdir) File "/home/atenagm/.local/lib/python2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir os.makedirs(path) File "/usr/lib/python2.7/os.py", line 157, in makedirs mkdir(name, mode) OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.10.dist-info'

Can anybody tell me what I should do to fix it? Thanks in advance.

2
If you are install django on UBUNTU then you have to use sudo pip install Django==1.10. sudo gives administrative rights.Usman Maqbool

2 Answers

1
votes

Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first:

pip install --user django==1.11
2
votes

You may need super user privilege to install a package globally. So append sudo before your command.

sudo pip install Django==1.10