为什么 Python repo 没有安装在 WSL 中?

Why Python repo is not installed in WSL?

从我的 WSL 终端

pip install schemathesis
Requirement already satisfied: schemathesis in /home/milenko/.local/lib/python3.8/site-packages (3.9.7)
Requirement already satisfied: hypothesis_jsonschema>=0.20.1 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (0.20.1)
Requirement already satisfied: requests<3.0,>=2.22 in /usr/lib/python3/dist-packages (from schemathesis) (2.22.0)
Requirement already satisfied: pytest>4.6.4 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (6.2.5)
Requirement already satisfied: pytest-subtests<1.0,>=0.2.1 in /home/milenko/.local/lib/python3.8/site-packages (from schemathesis) (0.5.0)

当我尝试时

:/mnt/c/Users/v-mimaholmes$ schemathesis

我得到了

schemathesis: command not found

如果我尝试 Tzane 建议的方法

 python3 -m schemathesis
/usr/bin/python3: No module named schemathesis.__main__; 'schemathesis' is a package and cannot be directly executed

pip freeze 输出

requests-unixsocket==0.2.0
schemathesis==3.9.7
SecretStorage==2.3.1

为什么?

我没有.local/lib.

在 WSL 上,架构脚本的安装位置不在 $PATH 中,正如 Shinra tensei 正确假设的那样。我尝试自己在 WSL Ubuntu 上安装它并得到以下信息:

 The script schemathesis is installed in '/home/taneli/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

和你一样的错误。将 ~/.local/bin 添加到 $PATH 后,它现在可以正常工作了:

export PATH=$PATH:~/.local/bin

不是 linux 向导所以我按照这个关于 $PATH 的附加:https://unix.stackexchange.com/a/26059