Python Nose Import Error

后端 未结 9 565
谎友^
谎友^ 2020-11-28 22:28

I can\'t seem to get the nose testing framework to recognize modules beneath my test script in the file structure. I\'ve set up the simplest example that demonstrates the p

9条回答
  •  时光取名叫无心
    2020-11-28 22:37

    Are you in a virtualenv? In my case, nosetests was the one in /usr/bin/nosetests, which was using /usr/bin/python. The packages in the virtualenv definitely won't be in the system path. The following fixed this:

    source myvirtualenv/activate
    pip install nose
    which nosetests
    /home/me/myvirtualenv/bin/nosetests
    

提交回复
热议问题