【问题标题】:pip not working after installing python3 on Mac在 Mac 上安装 python3 后 pip 不起作用
【发布时间】:2023-03-30 11:20:02
【问题描述】:

我从官网安装了python3,然后安装了jupyter notebook。在尝试运行 jupyter notebook 时,我收到“找不到命令”错误。

我找到了this github issue 并按照说明删除了 python3 并改用 Homebrew 重新安装(我以前使用过 Homebrew)。

在尝试python3 -m pip install --upgrade pip 时,我收到“没有名为 pip 的模块”错误。我的/usr/local/bin/ 文件显示 pip、pip2、pip2.7、pip3、pip3.6。

我感觉我的 pip 与我使用 Homebrew 安装的 python3 没有关联。我该如何解决这个问题?

【问题讨论】:

  • 你试过pip3而不是pip吗?
  • @Usernamenotfound 是的,我尝试了 pip3 并得到了同样的错误。虽然我可以在 usr/local/bin 文件夹中看到它

标签: python python-3.x pip homebrew


【解决方案1】:

这种方式是为特定的 python 解释器安装 pip 的一种非常简单的方法,当机器上有一大堆 pip 时:

$ curl https://bootstrap.pypa.io/get-pip.py > /tmp/get_pip.py
$ my_python_interpreter /tmp/get_pip.py

然后:

$ my_python_interpreter -m pip install some_dist

【讨论】:

    最近更新 更多