使用sudo命令pip install packages

时间:2016-02-16 20:01:41

标签: python linux

我正在尝试安装virtualenv软件包 -

首先,我直接尝试安装但获得权限被拒绝错误 第二,使用sudo命令的同一用户(具有sudo访问权限)告诉pip2.7不是命令。

为什么用户可以看到pip2.7但是没有使用sudo命令?

[lduser@q-dev-5461-4f3c-9d98-7af28dfc3ec6 bin]$ pip2.7 install virtualenv
Collecting virtualenv
  Using cached virtualenv-14.0.6-py2.py3-none-any.whl
Installing collected packages: virtualenv
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 731, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 841, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1040, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 343, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 321, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/virtualenv.pyc'



[duser@q-dev-5461-4f3c-9d98-7af28dfc3ec6 bin]$ sudo pip2.7 install virtualenv
sudo: pip2.7: command not found

0 个答案:

没有答案