tibifide
V2EX  ›  问与答

接口测试工具 httprunner,为什么 pip install 之后能在 cmd 中直接使用 httprunner 命令?

  •  
  •   tibifide · Jun 22, 2021 · 1644 views
    This topic created in 1968 days ago, the information mentioned may be changed or developed.

    pip install 后,相关文件下载到了 python 安装路径下的 site-packages 下面,但在环境变量 path 中又没有配置 httprunner 的路径,为什么能在 cmd 中直接使用 httprunner 的命令呢?

    8 replies  •  2021-06-22 13:18:23 +08:00
    killva4624
    killva4624
    Jun 22, 2021
    1
    cmd 里运行一下`where httprunner` 你就知道了~ LInux 下是 `which httprunner`
    Trim21
    Trim21
    Jun 22, 2021 via Android
    2
    因为 pip 会在 path 里面放一个 httprunner 的可执行文件
    tibifide
    tibifide
    OP
    Jun 22, 2021
    3
    @killva4624 使用的 httprunner 命令是作者上传到 pypi 的时候,添加的 httprunner.exe 文件吗?
    breezeFP
    breezeFP
    Jun 22, 2021
    4
    path 环境变量啊,你看看 httprunner(或是软连接)是不是在 path 指定的目录下
    tibifide
    tibifide
    OP
    Jun 22, 2021
    5
    @Trim21 看到了,在 scripts 里面有一个 httprunner.exe 可执行程序,这个程序是作者上传到 pypi 的时候,自己添加的文件吗?
    tibifide
    tibifide
    OP
    Jun 22, 2021
    6
    @breezeFP 不是 path,path 里面没有,@killva4624 回复了
    Trim21
    Trim21
    Jun 22, 2021
    7
    @tibifide #5 是 pip 生成的,作者只要在 entry_points 里添加 console_scripts 就可以了
    SenLief
    SenLief
    Jun 22, 2021
    8
    上传的时候配置的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4887 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 02:40 · PVG 10:40 · LAX 18:40 · JFK 21:40
    ♥ Do have faith in what you're doing.