问题
I've been learning Python using version 3.4. I recently started learning Web.py so have been using Python 2.7 for that, since web.py not supported in Python 3.4. I have nose 1.3.4 module installed for both Python 3.4 and 2.7. I need to run the nosetests command on some Python code written in 2.7 that uses the Web.py module. However, when I type nosetests command it automatically uses Python 3.4, so is throwing an error as unable to import the Web.py module in my Python code. Is there a way to force nosetests to use Python 2.7? Macbook Pro running OS X Yosemite.
回答1:
As @dano suggeted in his comment:
Try python2.7 -m nose
instead of running nosetests
.
来源:https://stackoverflow.com/questions/26579670/force-nosetests-to-use-python-2-7-instead-of-3-4