【发布时间】:2018-11-10 16:48:37
【问题描述】:
我刚刚为 WSL 安装了 Ubuntu,主要是为了在我学习 Python 编码时能够使用 linux 命令,尤其是 git 和 pytest。 我使用 bash shell 安装了 pytest,即使我安装了 python 3.7,但在运行 pytest 时,它使用的是 python 2.7:
Python 2.7.15rc1、pytest-3.3.2
当从 windows CMD 运行 pytest 时,它运行的是不同版本的 pytest python 3.7
Python 3.7.0,pytest-3.10.0
我意识到这可能是一个非常愚蠢的问题,但这是我第一次涉足基于 linux 的应用程序,我想知道如何在 bash shell 中使用最新的 python 版本运行 pytest。我阅读了一些帖子并且已经尝试过:
python3 -m pytest
python3.7 -m pytest
但收到以下消息:
/usr/bin/python3: 没有名为 pytest 的模块
有人可以帮帮我吗?
谢谢
【问题讨论】:
标签: ubuntu pytest windows-subsystem-for-linux