Phlip
Phlip

Reputation: 5343

PyCharm test gives: "ImportError: No module named nosetests"

The versions are PyCharm 2.7, nosetests-script.py version 1.2.1, and Python 2.6.8, via Python(x,y)-2.7.3.0. And Win7.

I can nosetest from the command line fine. But when I build a nosetests PyCharm configuration, and try to run or debug it, I get this:

 C:\Python27\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2.7\helpers\pycharm\noserunner.py" nosetests
 Testing started at 4:59 PM ...

 Error
 Traceback (most recent call last):
  File "C:\Python27\lib\unittest\case.py", line 327, in run
    testMethod()
  File "C:\Python27\lib\site-packages\nose\loader.py", line 379, in loadTestsFromName
    module = resolve_name(addr.module)
  File "C:\Python27\lib\site-packages\nose\util.py", line 321, in resolve_name
    module = __import__('.'.join(parts_copy))
 ImportError: No module named nosetests

Oh, and a couple versions ago it worked, briefly, then stopped working. Anyone have any idea how to get it working?

Upvotes: 4

Views: 3094

Answers (2)

John Wu
John Wu

Reputation: 1

I get the same error like this:

/Users/kwu/my_projects/virtualenv-root/env_py/bin/python2.7 "/Applications/PyCharm CE.app/Contents/helpers/pycharm/_jb_nosetest_runner.py" --path /Users/kwu/my_projects/frontline/Account -- nosetests --cover-branches --with-coverage --cover-erase --cover-package=Account
Testing started at 13:16 ... Launching Nosetest with arguments /Applications/PyCharm CE.app/Contents/helpers/pycharm/_jb_nosetest_runner.py /Users/kwu/my_projects/frontline/Account nosetests --cover-branches --with-coverage --cover-erase --cover-package=Account

Error
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 327, in run
    testMethod()
  File "/Users/kwu/my_projects/virtualenv-root/env_py/lib/python2.7/site-packages/nose/loader.py", line 407, in loadTestsFromName
    module = resolve_name(addr.module)
  File "/Users/kwu/my_projects/virtualenv-root/env_py/lib/python2.7/site-packages/nose/util.py", line 312, in resolve_name
    module = __import__('.'.join(parts_copy))
ImportError: No module named nosetests

This is because of my runner configure

my runner configure

is regard nosetests as an option.

I check you also regard nosetests as an option.

Upvotes: 0

Andrey Vlasovskikh
Andrey Vlasovskikh

Reputation: 16848

I've filed a bug report PY-8840 in PyCharm's issue tracker. Please vote for it in the issue tracker in order to get notifications.

Upvotes: 3

Related Questions