初学者安装nosetests包

发布于 2025-01-05 09:34:28 字数 881 浏览 0 评论 0原文

我正在尝试按照 learnpythonthehardway 教程安装以下内容:

  1. pip from http://pypi.python.org/pypi/pip< /a>
  2. http://pypi.python.org/pypi/distribute
  3. 鼻子 分发href="http://pypi.python.org/pypi/nose/">http://pypi.python.org/pypi/nose/
  4. virtualenv 来自 http://pypi.python.org/pypi/virtualenv

我访问了这些链接并单击了下载按钮;现在每个文件都在我的下载文件夹中,我解压/解压了它们 - 不确定这意味着什么,但似乎是必需的。它们是“安装”的吗?如果没有,真正安装它们意味着什么?我尝试在终端中输入 nosetests (正如书中所说的那样),也尝试过 easy_install 但这似乎不起作用。看来我的理解在很多方面都是有限的。

我收到以下 -bash: nosetests: command not found,但我正在尝试获取:

nosetests 。 -------------------------------------------------- -------------------- 在 0.007 秒内进行 1 次测试 好的

I'm trying to install the following as per the learnpythonthehardway tutorial:

  1. pip from http://pypi.python.org/pypi/pip
  2. distribute from http://pypi.python.org/pypi/distribute
  3. nose from http://pypi.python.org/pypi/nose/
  4. virtualenv from http://pypi.python.org/pypi/virtualenv

I've visited these links and clicked the download button; each file is in my downloads folder now, and I unarchive/unzipped them- not sure what this means but it seemed required. Are they "installed"? If not, what does it mean to really install them? I've tried typing nosetests in the terminal (as the book says you should), as well as tried easy_install but that doesn't seem to work. It appears my understanding is limited in a number of ways here.

I get the following -bash: nosetests: command not found, but am trying to get:

nosetests . ---------------------------------------------------------------------- Ran 1 test in 0.007s
OK

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

一生独一 2025-01-12 09:34:29

这适用于 Mac,也可能适用于 Linux

1)打开终端(准备输入密码)

2)输入:sudo easy_install pip

3)输入:sudo pip install distribution

4)类型:sudo pip install noose

5)类型:sudo pip install virtualenv

希望有所帮助,干杯!

This works on mac, it may work on linux

1)Open terminal (Be prepared to enter your password)

2)Type: sudo easy_install pip

3)Type: sudo pip install distribute

4)Type: sudo pip install nose

5)Type: sudo pip install virtualenv

Hope that helps, cheers!

倾听心声的旋律 2025-01-12 09:34:29

它们尚未安装。
每个软件包对于安装过程的具体工作方式都有自己的变幻莫测,事实上,其中一些软件包将包含其他软件包。 IE

“如果你使用virtualenv,pip的副本将自动生成
安装在您创建的每个虚拟环境中。”

http://pypi.python.org/pypi/pip

作为一个相对较新的 python 用户,(不久前也经历过类似的过程)我热切地等待着这个问题的更完整的答案。

They are not yet installed.
Each has its own vagaries about how exactly the install process works and in fact some of those packages will include the other packages with them. I.e.

"If you use virtualenv, a copy of pip will be automatically be
installed in each virtual environment you create."

http://pypi.python.org/pypi/pip

As a relatively new python user myself, (and having gone thru a similar process not long ago) I am eagerly awaiting the more complete answers that come back for this one.

所有深爱都是秘密 2025-01-12 09:34:29

你是在正确的轨道上,但这个包实际上被称为“鼻子”。鼻子的文档(nosetests 是脚本)可以在这里找到:
https://nose.readthedocs.org/en/latest/

简短的答案是,您有 2 个基本选项: easy_installpip。使用setuptools/distribute安装:easy_install noose。使用 pip 安装:pip install noose

You were on the right track, but the package is actually called "nose". The documentation for nose (nosetests is the script) can be found here:
https://nose.readthedocs.org/en/latest/

The short answer is that you have 2 basic options: easy_install or pip. Install using setuptools/distribute: easy_install nose. Install using pip: pip install nose

电影里的梦 2025-01-12 09:34:29

找出nosetests脚本在哪里。在 OSX 上:

/usr/local/share/nosetests

直接执行,或者设置 bash 别名,也许在 .bash_profile 中:

alias nosetests='/usr/local/share/python/nosetests'
alias nosetests3='/usr/local/share/python3/nosetests'

Find out where the nosetests script is. On OSX:

/usr/local/share/nosetests

Execute directly, or set up a bash alias, perhaps in .bash_profile:

alias nosetests='/usr/local/share/python/nosetests'
alias nosetests3='/usr/local/share/python3/nosetests'
与之呼应 2025-01-12 09:34:29

安装 Python 2.7,然后执行此操作(仅在 Windows - Windows PowerShell 上):

  1. 设置 PATH env:

C:\Python27\;C:\Python27\Scripts\", "用户"

  1. pip 已安装

3.

.\pip install distribute

4.

.\pip install nose

5.

.\pip install virtualenv

Install Python 2.7 and after just do this (only on Windows - Windows PowerShell):

  1. Setup PATH env:

C:\Python27\;C:\Python27\Scripts\", "User"

  1. pip is already installed

3.

.\pip install distribute

4.

.\pip install nose

5.

.\pip install virtualenv
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文