在Mac上安装python3后,pip无法正常工作 [英] pip not working after installing python3 on Mac

查看:601
本文介绍了在Mac上安装python3后,pip无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从官方网站安装了python3,然后安装了jupyter笔记本.尝试运行jupyter笔记本时,出现找不到命令"错误.

I installed python3 from the official website and then installed jupyter notebook. While trying to run jupyter notebook, I was getting a "command not found" error.

我发现了此github问题,并按照说明删除了python3并使用重新安装而是使用Homebrew(我以前使用过Homebrew).

I found this github issue and followed the instructions to delete python3 and reinstall using Homebrew instead (I've used Homebrew before).

尝试python3 -m pip install --upgrade pip时,出现没有名为pip的模块"错误.我的/usr/local/bin/文件显示了pip,pip2,pip2.7,pip3,pip3.6.

When trying python3 -m pip install --upgrade pip i get a "No module named pip" error. My /usr/local/bin/ file shows pip, pip2, pip2.7, pip3, pip3.6.

我感到我的点子与我使用Homebrew安装的python3没有关联.我该如何解决?

I have a feeling my pip is not associated with the python3 that I installed using Homebrew. How can I fix this?

推荐答案

当您在机器上有很多混乱时,这种方法是一种非常简单的方法来为特定的python解释器安装pip:

This way is a pretty fool-proof way to install pip for a specific python interpreter, when you have a big mess of them on the machine:

$ 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

这篇关于在Mac上安装python3后,pip无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆