Error running nosetests

杀马特。学长 韩版系。学妹 提交于 2020-01-03 17:27:50

问题


I recently reinstalled nose to run tests on my code.

https://nose.readthedocs.org/en/latest/

I used

sudo pip install nose

and went to my project folder. The response is

-bash: nosetests: command not found.

So, I once again I uninstalled and tried installing nose with MacPorts:

sudo port install py27-nose

In my project folder, I run

nosetests-2.7 filename.py

and I get the following error:

ERROR: Failure: ImportError (No module named nose_parameterized)

What's the problem?

EDIT: More information. nose is installed. I get Successfully installed nose-1.3.6.


回答1:


So, the way I've made it work is by specifically downloading nose-parameterized

sudo pip install nose-parameterized

Previously nose would work in the project's directory, but the trials would always be very quick. For example,

Ran 0 tests in 0.002s

I'm more confused now than previously. Why would I have to download nose-parameterized individually?




回答2:


I don't have any experience with MacPorts python but I know that Homebrew installs python using a completely different site-packages setup than the OS X provided versions. From the looks of your error messages, it looks like you were mixing a matching the system pip and the ports python which could be the cause of your issue.



来源:https://stackoverflow.com/questions/29925801/error-running-nosetests

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