繁体   English   中英

如何在没有sudo或wget或brew或easy_install的情况下安装pip?

[英]How to install pip without sudo or wget or brew or easy_install?

我正在尝试下载点子,但没有sudo访问权限。 我收到此错误:

Exception:
Traceback (most recent call last):
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/basecommand.py", line 215, in main
status = self.run(options, args)
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/req/req_set.py", line 742, in install
**kwargs
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
  File "/var/folders/h3/mg0jxd6x7v9gmrg89kcwxbfcpm025t/T/tmp0PONb0/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'

我尝试过许多其他解决方案,但是每个解决方案都需要sudo,wget,brew和/或easy_install等。有人可以提供我应该采取的没有这些步骤来下载pip的步骤吗?

谢谢!

使用virtualenv

创建并激活virtualenv并将软件包安装在virualenv中。 您不需要sudo访问。

https://pip.pypa.io/zh_CN/stable/installing/

您可以下载.py文件并运行它以安装pip。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM