相关疑难解决方法(0)

为Python安装pip,virtualenv和分发的正确方法是什么?

简短的问题

背景

问题4314376的回答中,我建议使用,ez_setup以便您可以安装pipvirtualenv如下:

curl -O http://peak.telecommunity.com/dist/ez_setup.py
sudo python ez_setup.py
sudo easy_install pip
sudo pip install virtualenv
Run Code Online (Sandbox Code Playgroud)

我最初是从Jesse Noller的博客文章中提取这些说明的,所以你想在Mac上使用Python?.我喜欢保持一个干净的全局site-packages目录的想法,所以我安装的唯一其他软件包就是 virtualenvwrapperdistribute.(distribute由于这个Python公共服务公告,我最近添加到了我的工具箱.为了安装这两个软件包,我使用了:

sudo pip install virtualenvwrapper
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
Run Code Online (Sandbox Code Playgroud)

没有更多的setuptools和easy_install

要真正遵循Python公共服务公告,在全新的Python安装上,我会执行以下操作:

curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo easy_install pip
sudo pip install virtualenv
sudo pip install virtualenvwrapper
Run Code Online (Sandbox Code Playgroud)

雕文的Rebuke

在一个评论我的回答 …

python setuptools virtualenv distribute

245
推荐指数
7
解决办法
15万
查看次数

已安装的Nose但无法在命令行上使用

我使用Python2.7.9在Mac OSX 10.10.5上安装了Nose easy_install.安装似乎是成功的:

Collecting nose
  Downloading nose-1.3.7-py2-none-any.whl (154kB)
    100% |????????????????????????????????| 155kB 2.3MB/s 
Installing collected packages: nose
Successfully installed nose-1.3.7
Run Code Online (Sandbox Code Playgroud)

但是现在,当我在命令行上尝试使用nosetests的基本内容时,nosetests -h或者which nosetests我只是得到:

bash: nosetests: command not found
Run Code Online (Sandbox Code Playgroud)

我已尝试卸载,重新安装使用pip,尝试安装,sudo然后sudo nostests在其他帖子建议的测试脚本的目录中运行,但似乎没有任何工作.

安装的最初目的是使用nose来运行我为这些简单的web.py应用程序编写的测试脚本运行一些基本测试.但没有任何作用,只是不断获得command not found回应.

奇怪的是,当我在终端中打开Python解释器时,执行以下操作:

import nose 
nose.main()
Run Code Online (Sandbox Code Playgroud)

我得到了预期的结果:

.
----------------------------------------------------------------------
Ran 1 test in 0.135s

OK
Run Code Online (Sandbox Code Playgroud)

很明显,它安装在某个地方.关于到底发生了什么的任何建议?

python macos nose python-2.7

16
推荐指数
3
解决办法
1万
查看次数

标签 统计

python ×2

distribute ×1

macos ×1

nose ×1

python-2.7 ×1

setuptools ×1

virtualenv ×1