mac电脑下pip安装库后,仍然提示command not found

如:pip install httprunner,安装成功后输入hrun -V 提示"command not found"。

造成这个问题的原因是PATH环境变量的问题,因为使用的是homebrew安装的python,导致pip bin目录的环境变量没注册上。

解决办法是将python bin目录加入环境变量。

1.打开终端,进vi编辑器

bash 复制代码
vi ~/.bash_profile

2.添加一行

bash 复制代码
export PATH=${PATH}:你的python安装bin目录

3.刷新配置文件

bash 复制代码
source ~/.bash_profile
相关推荐
hui函数30 分钟前
如何解决 pip install 编译报错 ‘cl.exe’ not found(缺少 VS C++ 工具集)问题
开发语言·c++·pip
hui函数2 小时前
Python系列Bug修复|如何解决 pip install 安装报错 invalid command ‘bdist_wheel’(缺少 wheel)问题
python·bug·pip
hui函数2 小时前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有索引未设为 trusted-host 导致拒绝 问题
python·bug·pip
hui函数3 小时前
Python系列Bug修复|如何解决 pip install 安装报错 Backend ‘setuptools.build_meta’ 不可用 问题
python·bug·pip
雪域迷影3 小时前
MacOS中安装并配置Redis
redis·macos·策略模式
猫头虎4 小时前
Claude Code 2026 年1月9日迎来大更新:Agent 能力增强(2.1.0 详解 + 升级指南)
ide·人工智能·macos·langchain·编辑器·aigc·ai编程
小锋学长生活大爆炸4 小时前
【踩坑】MacOS26开启软件的麦克风权限,如腾讯会议
macos·会议·腾讯会议·安全模式·权限·踩坑·麦克风
hui函数5 小时前
Python系列Bug修复|如何解决 pip install -r requirements.txt 私有仓库认证失败 401 Unauthorized 问题
python·bug·pip
hui函数5 小时前
Python系列Bug修复|如何解决 pip install -r requirements.txt 子目录可编辑安装缺少 pyproject.toml 问题
python·bug·pip
有个人神神叨叨5 小时前
AITalk:从零到一打造 macOS 系统级语音输入引擎
macos·策略模式