简体   繁体   English

点子不安装鼻子包

[英]Pip not installing nose package

First off, let me say I'm a newbie to the Unix command line, so forgive me if anything sounds naive. 首先,让我说我是Unix命令行的新手,所以请原谅我。 I've installed pip on my machine and I'm trying to use it to install nose. 我已经在机器上安装了pip,并且尝试使用它来安装机鼻。 I have a nose zip file in my downloads folder and I'm trying to install it into my sitepackages directory so I can begin using it for unit testing. 我的downloads文件夹中有一个zip压缩文件,我正在尝试将其安装到sitepackages目录中,以便可以开始将其用于单元测试。 In terminal, I typed in pip install nose and got what you see below.Any idea what's going on here? 在终端中,我输入了pip install鼻子,并在下面看到了您的意思。知道这是怎么回事吗? Do I need to use sudo or does the nose zip file need to be placed in another directory to be accessed by pip perhaps?... 我需要使用sudo还是需要将zip鼻子文件放在另一个目录中以便pip进行访问?

Downloading/unpacking nose
Downloading nose-1.3.0.tar.gz (404kB): 404kB downloaded
Running setup.py egg_info for package nose

    no previously-included directories found matching 'doc/.build'
Installing collected packages: nose
Running setup.py install for nose
error: could not create '/Library/Python/2.7/site-packages/nose': Permission denied
Complete output from command /usr/bin/python -c "import setuptools;__file__='/private/var/folders/yy/4vm2zy7j5_s32zv4rwdhn5500000gn/T/pip-build-mikaschiller/nose/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/yy/4vm2zy7j5_s32zv4rwdhn5500000gn/T/pip-YKue2u-record/install-record.txt --single-version-externally-managed:
running install

running build

running build_py

creating build

creating build/lib

creating build/lib/nose

copying nose/__init__.py -> build/lib/nose

copying nose/__main__.py -> build/lib/nose

copying nose/case.py -> build/lib/nose

copying nose/commands.py -> build/lib/nose

copying nose/config.py -> build/lib/nose

copying nose/core.py -> build/lib/nose

copying nose/exc.py -> build/lib/nose

copying nose/failure.py -> build/lib/nose

copying nose/importer.py -> build/lib/nose

copying nose/inspector.py -> build/lib/nose

copying nose/loader.py -> build/lib/nose

copying nose/proxy.py -> build/lib/nose

copying nose/pyversion.py -> build/lib/nose

copying nose/result.py -> build/lib/nose

copying nose/selector.py -> build/lib/nose

copying nose/suite.py -> build/lib/nose

copying nose/twistedtools.py -> build/lib/nose

copying nose/util.py -> build/lib/nose

creating build/lib/nose/ext

copying nose/ext/__init__.py -> build/lib/nose/ext

copying nose/ext/dtcompat.py -> build/lib/nose/ext

creating build/lib/nose/plugins

copying nose/plugins/__init__.py -> build/lib/nose/plugins

copying nose/plugins/allmodules.py -> build/lib/nose/plugins

copying nose/plugins/attrib.py -> build/lib/nose/plugins

copying nose/plugins/base.py -> build/lib/nose/plugins

copying nose/plugins/builtin.py -> build/lib/nose/plugins

copying nose/plugins/capture.py -> build/lib/nose/plugins

copying nose/plugins/collect.py -> build/lib/nose/plugins

copying nose/plugins/cover.py -> build/lib/nose/plugins

copying nose/plugins/debug.py -> build/lib/nose/plugins

copying nose/plugins/deprecated.py -> build/lib/nose/plugins

copying nose/plugins/doctests.py -> build/lib/nose/plugins

copying nose/plugins/errorclass.py -> build/lib/nose/plugins

copying nose/plugins/failuredetail.py -> build/lib/nose/plugins

copying nose/plugins/isolate.py -> build/lib/nose/plugins

copying nose/plugins/logcapture.py -> build/lib/nose/plugins

copying nose/plugins/manager.py -> build/lib/nose/plugins

copying nose/plugins/multiprocess.py -> build/lib/nose/plugins

copying nose/plugins/plugintest.py -> build/lib/nose/plugins

copying nose/plugins/prof.py -> build/lib/nose/plugins

copying nose/plugins/skip.py -> build/lib/nose/plugins

copying nose/plugins/testid.py -> build/lib/nose/plugins

copying nose/plugins/xunit.py -> build/lib/nose/plugins

creating build/lib/nose/sphinx

copying nose/sphinx/__init__.py -> build/lib/nose/sphinx

copying nose/sphinx/pluginopts.py -> build/lib/nose/sphinx

creating build/lib/nose/tools

copying nose/tools/__init__.py -> build/lib/nose/tools

copying nose/tools/nontrivial.py -> build/lib/nose/tools

copying nose/tools/trivial.py -> build/lib/nose/tools

copying nose/usage.txt -> build/lib/nose

running install_lib

creating /Library/Python/2.7/site-packages/nose

error: could not create '/Library/Python/2.7/site-packages/nose': Permission denied

您需要使用sudo pip install nosesudo

You are trying to install nose globally without having the necessary permissions. 您试图在没有必要权限的情况下全局安装鼻子。

You can either use sudo pip install nose , or, preferably, use virtual environments ( https://virtualenv.readthedocs.org/en/latest/ ) for your development. 您可以使用sudo pip install nose ,或者最好使用虚拟环境( https://virtualenv.readthedocs.org/en/latest/ )进行开发。 With those, you can install and remove things without root permissions, you cannot mess up your global setup and you can use different versions of libraries within different projects you are working on. 有了它们,您就可以在没有root权限的情况下安装和删除内容,也不会破坏全局设置,并且可以在正在处理的不同项目中使用不同版本的库。

If you try virtual environments, also take a look at virtualenvwrapper , that helps a lot in keeping them organized. 如果您尝试使用虚拟环境,还可以看看virtualenvwrapper ,这对保持它们的组织很有帮助

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

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