'nosetests' not recognized on Windows after being installed and added to PATH

六月ゝ 毕业季﹏ 提交于 2019-12-09 05:52:54

问题


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.

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


回答1:


If you are still having trouble after following Warren Weckesser's instructions try uninstalling and reinstalling.

Using pip: pip uninstall nose

I found this worked for me on Windows 8 64 bit




回答2:


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.




回答3:


You can also use python -m nose in PowerShell.

This worked for me in Windows 7, 32 bit.




回答4:


Command: python -m nose or py -m nose

Remember you should stay in the current virtual environment to run the nose if it is installed locally. Check the local environment name lpthw in the PowerShell after you activate the same.



来源:https://stackoverflow.com/questions/12328678/nosetests-not-recognized-on-windows-after-being-installed-and-added-to-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!