python - Error while installing pip package without sudo -


when try install request package without using sudo error how can fix it.

pip install --user requests --upgrade

collecting requests https://pypi.python.org/packages/py2.py3/r/requests/requests-2.6.0-py2.py3-none-any.whl#md5=3ab1972bbaf2802d94516fb86b9b0d0b   downloading requests-2.6.0-py2.py3-none-any.whl (469kb)     100% |################################| 471kb 199kb/s  installing collected packages: requests   exception:   traceback (most recent call last):     file "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 232, in main       status = self.run(options, args)     file "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 347, in run       root=options.root_path,     file "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 549, in install       **kwargs     file "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 754, in install       self.move_wheel_files(self.source_dir, root=root)     file "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 963, in move_wheel_files       isolated=self.isolated,     file "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 137, in move_wheel_files       name, user=user, home=home, root=root, isolated=isolated     file "/usr/local/lib/python2.7/dist-packages/pip/locations.py", line 236, in distutils_scheme       i.finalize_options()     file "/usr/lib/python2.7/distutils/command/install.py", line 357, in finalize_options       self.create_home_path()     file "/usr/lib/python2.7/distutils/command/install.py", line 593, in create_home_path       os.makedirs(path, 0700)     file "/usr/lib/python2.7/os.py", line 157, in makedirs       mkdir(name, mode)   oserror: [errno 13] permission denied: '/home/mohd/.local/lib/python2.7/site-packages' 

edit:

drwx------ 4 mohd mohd 4096 mar 23 10:12 . drwx------ 5 mohd mohd 4096 mar  3 18:09 .. drwx------ 3 root root 4096 mar  3 18:09 python2.7 drwx------ 3 mohd mohd 4096 mar 23 10:12 python3.4 

try in python2.7's folder in path '/home/$user/.local/lib/python2.7/site-packages'

sudo chown -r $user:$user python2.7/ 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -