简体   繁体   English

导入包 (pip) 工具在 Mac 上不起作用

[英]Import packages (pip) facility doesn't work on Mac

probably was asked 100 times but I will try once again ( maybe will get a simple answeR) I used the commands: url https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get-pip.py from a mac terminal to install pip.可能被问了 100 次,但我会再试一次(也许会得到一个简单的答案) 我使用了以下命令:url https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3 get- pip.py 从 mac 终端安装 pip。 When I am going to the IDLE shell window and I am typing: pip3 install numpy I am getting a syntax error even though it's supposed to work.当我要去 IDLE shell window 时,我正在输入: pip3 install numpy 即使它应该工作,我也会遇到语法错误。

Can somebody explain to me what is the issue?有人可以向我解释这是什么问题吗? I am not keen on downloading Anaconda as I like to keep my environment simple enough.我不热衷于下载 Anaconda,因为我想让我的环境足够简单。 I am working with a mac notebook.我正在使用 Mac 笔记本电脑。 any help will be most appreciated.任何帮助将不胜感激。

Thanks, YK谢谢,YK

You cant install packages through the python idle.您不能通过空闲的 python 安装软件包。 Try installing numpy through your mac terminal.尝试通过您的 mac 终端安装 numpy。 If it still does not work check if pip is even installed by pip --version or pip3 --version .如果它仍然不起作用,请检查pip --versionpip3 --version是否安装了 pip 。 The reason that downloading a package in the python IDLE does not work is because the python IDLE only understands valid python code(it is a python interpreter), and because pip3 install numpy is not python code it does not work The reason that downloading a package in the python IDLE does not work is because the python IDLE only understands valid python code(it is a python interpreter), and because pip3 install numpy is not python code it does not work

The IDLE shell window is a Python interpreter and only understand python syntax. IDLE shell window 是 Python 解释器,只理解 Z23EEEB4347BDD2756BFC6B7EE9A 语法Since pip3 install numpy is not valid Python, you get a syntax error.由于pip3 install numpy不是有效的 Python,您会收到语法错误。 Instead, you need to open Terminal and type the command there.相反,您需要打开终端并在那里键入命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM