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

4

8

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.

Guttate answered 8/9, 2012 at 6:47 Comment(3)
I haven't used command line on Windows for a long time, but it looks like the command nosetests is not in one of the directories (folders) specified in your PATH environment variable.Bullen
In Windows, I've had to either start a new command prompt, or even log out and log in again, for a change in PATH made via the "System Properties" window to take effect. Have you tried that?Anastasia
@WarrenWeckesser That did it! Thank you so much, I can't believe it was such a trivial issue.Guttate
A
3

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

Actinoid answered 10/2, 2013 at 19:29 Comment(0)
B
3

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. See here

Beet answered 24/6, 2017 at 11:13 Comment(0)
E
2

You can also use python -m nose in PowerShell.

This worked for me in Windows 7, 32 bit.

Eugenieeugenio answered 14/9, 2016 at 17:59 Comment(0)
F
0

enter image description here

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.

Fishman answered 22/10, 2018 at 18:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.