V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
tibifide
V2EX  ›  问与答

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

  •  
  •   tibifide · 2021-06-22 10:14:25 +08:00 · 824 次点击
    这是一个创建于 1010 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    8 条回复    2021-06-22 13:18:23 +08:00
    killva4624
        1
    killva4624  
       2021-06-22 10:28:53 +08:00
    cmd 里运行一下`where httprunner` 你就知道了~ LInux 下是 `which httprunner`
    Trim21
        2
    Trim21  
       2021-06-22 10:30:20 +08:00 via Android
    因为 pip 会在 path 里面放一个 httprunner 的可执行文件
    tibifide
        3
    tibifide  
    OP
       2021-06-22 10:43:44 +08:00
    @killva4624 使用的 httprunner 命令是作者上传到 pypi 的时候,添加的 httprunner.exe 文件吗?
    breezeFP
        4
    breezeFP  
       2021-06-22 10:44:10 +08:00
    path 环境变量啊,你看看 httprunner(或是软连接)是不是在 path 指定的目录下
    tibifide
        5
    tibifide  
    OP
       2021-06-22 10:44:41 +08:00
    @Trim21 看到了,在 scripts 里面有一个 httprunner.exe 可执行程序,这个程序是作者上传到 pypi 的时候,自己添加的文件吗?
    tibifide
        6
    tibifide  
    OP
       2021-06-22 10:45:20 +08:00
    @breezeFP 不是 path,path 里面没有,@killva4624 回复了
    Trim21
        7
    Trim21  
       2021-06-22 11:26:53 +08:00
    @tibifide #5 是 pip 生成的,作者只要在 entry_points 里添加 console_scripts 就可以了
    SenLief
        8
    SenLief  
       2021-06-22 13:18:23 +08:00
    上传的时候配置的。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1048 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 19:16 · PVG 03:16 · LAX 12:16 · JFK 15:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.