playwright:command not found: playwright 未找到命令

背景

看官文中的代码生成器:
playwright codegen playwright.dev
image

解决方法-1

打开终端执行:
python3 -m playwright codegen playwright.dev
image

解决方法-2

在安装playwright的时候会提示:
image
我们打开~/.bash_profile

 export PATH="/home/uniontech/.local/bin:$PATH"

在终端执行:

source ~/.bash_profile

这样在终端执行直接执行playwright

image

其他知识

python3 -m作用:
image

-m能给我们的好处是:已知一个模块的名字,但不知道它的文件路径,那么使用“-m”就意味着交给解释器自行查找,在所有模块命名空间中查找,定位到脚本的路径,则当成脚本执行。

来源:https://www.yanxishe.com/columnDetail/18600

posted @ 2022-11-02 14:43  Tarzen  阅读(2061)  评论(0编辑  收藏  举报