Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Nosetests to Use Python 2.7 instead of 3.4

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.

like image 858
diggers Avatar asked Oct 27 '14 00:10

diggers


1 Answers

As @dano suggeted in his comment:

Try python2.7 -m nose instead of running nosetests.

like image 110
diggers Avatar answered Nov 12 '22 01:11

diggers