首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Pip未安装nose包

Pip未安装nose包
EN

Stack Overflow用户
提问于 2013-05-08 13:29:59
回答 2查看 4.7K关注 0票数 1

首先,让我说我是Unix命令行的新手,所以如果有什么听起来很天真的话,请原谅我。我已经在我的机器上安装了pip,并且我正在尝试使用它来安装nose。我的downloads文件夹中有一个nose文件,我正在尝试将它安装到我的sitepackages目录中,这样我就可以开始使用它进行单元测试。在终端中,我输入pip install nose,然后就得到了你所看到的,知道这是怎么回事吗? below.Any?我是否需要使用sudo,或者是否需要将nose文件放在另一个目录中才能被pip访问?

代码语言:javascript
复制
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
EN

回答 2

Stack Overflow用户

发布于 2013-05-08 13:35:21

你需要用sudo作为pip install nose的前缀。

票数 3
EN

Stack Overflow用户

发布于 2013-05-08 13:39:19

您正试图在没有必要权限的情况下全局安装nose。

您可以使用sudo pip install nose,或者最好使用虚拟环境(https://virtualenv.readthedocs.org/en/latest/)进行开发。有了这些,你可以在没有root权限的情况下安装和删除东西,你不能搞乱你的全局设置,你可以在你正在处理的不同项目中使用不同版本的库。

如果你尝试虚拟环境,也可以看看virtualenvwrapper,这对保持它们的组织有很大的帮助。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16433304

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档