Force Nosetests to Use Python 2.7 instead of 3.4

你。 提交于 2019-12-22 05:17:50

问题


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

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