简体   繁体   English

Mac 安装 python 不用开发者工具

[英]Mac install python without developer tools

I am trying to install python 3.11 without the Mac developer tools, which will give me python3.9.我正在尝试在没有 Mac 开发人员工具的情况下安装 python 3.11,这将给我 python3.9。 But when I used the vscode to open a python file, the command line installer poped up and showed the following message 'the python3 command requires the command line developer tools....'.但是当我使用 vscode 打开一个 python 文件时,命令行安装程序弹出并显示以下消息“python3 命令需要命令行开发工具....”。 But I can run the python3 command in the terminal successfully.但是我可以在终端成功运行 python3 命令。

The annoying part is the pop up window. I found some suggestions about relink or rebuild the Xcode / command line tools.烦人的部分是弹出窗口 window。我发现了一些关于重新链接或重建 Xcode / 命令行工具的建议。 But in my case, there is no Xcode path.但就我而言,没有 Xcode 路径。 Please let me know if there is a way to configure the path correctly.如果有正确配置路径的方法,请告诉我。

Thank you,谢谢,

I checked the link of python3 in /usr/bin I install the python directly from the http://python.org我在 /usr/bin 中检查了 python3 的链接 我直接从http://python.org 安装 python

Do you use Homebrew in your terminal?你在终端中使用Homebrew吗?

You can try to run brew link --overwrite --dry-run python@3.11 in your terminal to see if you need to do an update for your env path.您可以尝试在终端中运行brew link --overwrite --dry-run python@3.11以查看是否需要对环境路径进行更新。 If you do need it, the terminal will give you suggestions to relink, ex.如果你确实需要它,终端会给你建议重新链接,例如。 brew link --overwrite python@3.11 or rm '/usr/local/bin/2to3-3.11' brew link --overwrite python@3.11rm '/usr/local/bin/2to3-3.11'


I also had an issue when installing python3.11 through Homebrew in my terminal, it said I must use xcode-select --install to install python3.11.我在终端中通过Homebrew安装 python3.11 时也遇到了问题,它说我必须使用xcode-select --install来安装 python3.11。

So later on, I followed this video step by step, and now it works.所以后来,我按照这个视频一步一步来,现在可以了。 Whenever I check python3 --version , it returns Python 3.11.1 .每当我检查python3 --version时,它都会返回Python 3.11.1 It also allows me to install another library that depends on python3.11.它还允许我安装另一个依赖于 python3.11 的库。

Maybe it is worth checking the current version in your terminal and seeing if need to install again the package.也许值得检查终端中的当前版本,看看是否需要再次安装 package。

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

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