You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

安装lit后无法找到工具:执行python pip install lit成功但which lit无返回

Troubleshooting: lit not found after successful installation

Hey there, let's work through why which lit returns nothing even though your install seemed to complete successfully! Here are the most common fixes:

1. First, find where lit was actually installed

Let's pinpoint the exact location of the installed lit files. Run this command:

python -m pip show lit

Look for the Location line in the output—this tells you where the package lives. The lit executable script will be in a bin (Linux/macOS) or Scripts (Windows) folder relative to this path. For example:

  • On Linux/macOS, it’s often ~/.local/bin/lit if you installed with user-level permissions
  • On Windows, it might be %APPDATA%\Python\Python3X\Scripts\lit.exe

2. Check if the install directory is in your PATH

Your shell uses the PATH environment variable to find executable commands. Run echo $PATH (Linux/macOS) or echo %PATH% (Windows) to see if the bin/Scripts folder from step 1 is listed. If it’s missing:

  • Quick temporary fix: Run lit using its full absolute path (e.g., ~/.local/bin/lit on Linux)
  • Permanent fix: Add the directory to your PATH:
    • Linux/macOS: Add this line to your ~/.bashrc, ~/.zshrc, or shell config file:
      export PATH="$HOME/.local/bin:$PATH"
      
      Then restart your shell or run source ~/.bashrc to apply changes.
    • Windows: Open System Properties → Advanced → Environment Variables, edit the user-level Path variable, add the Scripts folder path, and restart your terminal.

3. Run lit directly via Python (bypass PATH issues)

If you don’t want to tweak PATH right now, you can run lit using Python’s module runner—this works regardless of PATH settings:

python -m lit

4. Check for conflicting Python environments

If you have multiple Python versions (like python vs python3) or virtual environments, you might have installed lit in one environment but are checking another. Verify your pip and Python match:

pip --version
python --version

If they don’t align, reinstall lit using the correct Python version (e.g., python3 -m pip install lit).


内容的提问来源于stack exchange,提问作者sean

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:10:48