简体   繁体   English

Python 通用安装与 conda

[英]Python universal install with conda

I recently got a new M1 MacBook and have been trying to get my Python Dev environment setup.我最近买了一台新的 M1 MacBook,并一直在尝试设置我的 Python 开发环境。 I'm new to conda (previously used virtualenv) and I'm wondering if there's a way to use the Python 3.9.4 universal2 install.我是 conda 的新手(以前使用 virtualenv),我想知道是否有办法使用 Python 3.9.4 universal2 安装。 3.9.2 is the highest version listed, and I can't see how to distinguish it from the Intel/ARM installations, but running platform.machine() outputs x86_64, so it seems I have the Intel install by default. 3.9.2 是列出的最高版本,我看不出如何将它与 Intel/ARM 安装区分开来,但运行 platform.machine() 输出 x86_64,所以我似乎默认安装了 Intel。 Any way to manage this?有什么办法可以管理这个?

Step 1: Come here Scroll down to the line Anaconda 2019.03 for macOS Installer.第 1 步:来这里向下滚动到 macOS 安装程序的 Anaconda 2019.03 行。

You need to know your Python version.您需要知道您的 Python 版本。 To do this, write in the terminal为此,请在终端中写入

光伏

And select Command Line Installer和 select 命令行安装程序

Step 2: installing via command line After the installation is complete, go to the terminal.第二步:通过命令行安装安装完成后,go到终端。

If you have Python 3.7, then run:如果您有 Python 3.7,则运行:

bash ~ / Downloads / Anaconda3–2019.03-MacOSX-x86_64.sh bash ~ / 下载 / Anaconda3–2019.03-MacOSX-x86_64.sh

For Python 2.7:对于 Python 2.7:

bash ~ / Downloads / Anaconda2–2019.03-MacOSX-x86_64.sh bash ~ / 下载 / Anaconda2–2019.03-MacOSX-x86_64.sh

Attention: if you downloaded Anaconda not in the Downloads folder, then in the commands you need to change the path to the distribution kit.注意:如果您下载的 Anaconda 不在 Downloads 文件夹中,则需要在命令中更改分发包的路径。

Review the license agreement and press Enter.查看许可协议并按 Enter。 Finally, after a million Enter hits, type yes if you accept the license agreement.最后,在一百万次 Enter 命中后,如果您接受许可协议,请键入 yes。

(If you do not accept the agreement in time, then this clue will constantly catch your eye) (如果你不及时接受协议,那么这条线索会不断吸引你的眼球)

伊斯特

if you are satisfied with the installation path, then press Enter.如果您对安装路径满意,请按 Enter。 You can change the location or abort the installation by pressing CTRL-C.您可以通过按 CTRL-C 更改位置或中止安装。

Then you will be asked: Do you wish the installer to initialize Anaconda3 by running conda init?然后你会被问到:你希望安装程序通过运行 conda init 来初始化 Anaconda3 吗? Write yes, of course.写是的,当然。

When the installation is complete, close a terminal window and open a new one - this will take effect your changes.安装完成后,关闭终端 window 并打开一个新终端 - 这将使您的更改生效。 Want to make sure everything works?想确保一切正常吗? Type conda list and see what happens.输入 conda list 看看会发生什么。 If everything works, you will see something like this:如果一切正常,您将看到如下内容: 资源

If everything works, then congratulations, Now you can use Anaconda, Jupyter Notebooks.如果一切正常,那么恭喜你,现在你可以使用 Anaconda,Jupyter Notebooks。 Spyder and other useful things. Spyder 和其他有用的东西。

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

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