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
.
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
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.
You can also use python -m nose
in PowerShell.
This worked for me in Windows 7, 32 bit.
来源:https://stackoverflow.com/questions/12328678/nosetests-not-recognized-on-windows-after-being-installed-and-added-to-path