Windows上安装并添加到PATH后无法识别"nosetests" [英] 'nosetests' not recognized on Windows after being installed and added to PATH

查看:332
本文介绍了Windows上安装并添加到PATH后无法识别"nosetests"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以困难的方式学习Python"练习46 ,安装鼻子并进行鼻子测试.我已经使用pip安装过鼻子,但是当我在测试"文件夹上方的目录中运行鼻子测试时,出现错误:

I'm on exercise 46 of Learn Python the Hard Way, and I'm meant to install nose and run nosetests. I've installed nose already using pip, but when I run nosetests in the directory above the 'tests' folder, I get the error:

'nosetests' is not recognized as an internal or external command, operable program or batch file.

如果相关,我已经修改了PATH变量以包含Python27/ScriptsPython/Lib/site-package的完整路径.

If it's relevant, I've already modified the PATH variable to include full path of Python27/Scripts and Python/Lib/site-package.

推荐答案

我使用Windows,但遇到了同样的问题.LPTHW书基于Linux OS,对于Windows用户来说有点困难. 键入鼻子测试时,出现错误.然后,按照Spellstaker的说法,我输入了python -m鼻子,它工作得很好.我已经注意到,在大多数情况下,我们需要在开始时添加'python -m'才能使其在Windows上运行.

I use Windows and I had the same problem.The LPTHW book is based on Linux OS and it's a bit difficult for windows users. When I typed nosetests, I got errors. Then I typed python -m nose , as per said by Spellstaker and it worked perfectly. I have noticed that in most cases we need to add 'python -m' at the beginning to make it work on Windows.

这篇关于Windows上安装并添加到PATH后无法识别"nosetests"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆