V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
tibifide
V2EX  ›  问与答

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

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