Skip to main content
 首页 » 编程设计

python之在 Mac 上安装 python3 后 pip 不工作

2024年09月07日8Free-Thinker

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

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

当尝试 python3 -m pip install --upgrade pip 时,出现“No module named pip”错误。我的 /usr/local/bin/ 文件显示 pip、pip2、pip2.7、pip3、pip3.6。

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

请您参考如下方法:

当你的机器上有一大堆它们时,这种方法是为特定 python 解释器安装 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