mac下直接使用brew 安装python和jupyterlab

python安装

brew install python

Jupyter Lab简介

Jupyter Lab是一个开源的交互式开发环境,用于数据科学、编程和教育等多个领域12。

它是Jupyter Notebook的扩展和进化版本,提供了更加强大和灵活的界面。Jupyter Lab除了具有Notebook功能外,还集成了代码编辑器、终端、文件浏览器等,提供了一个更完整的开发环境。用户可以实时运行代码,探索数据集,创建动态的数据可视化,这对于数据分析和科学研究非常有用。Jupyter Lab支持丰富的插件系统,用户可以根据自己的需求安装不同的扩展,如数据可视化工具、版本控制等。

JupyterLab安装

brew install jupyterlab

==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> New Casks
hhkb-studio

You have 4 outdated formulae installed.

Warning: Treating jupyterlab as a formula. For the cask, use homebrew/cask/jupyterlab or specify the `--cask` flag.
==> Downloading https://ghcr.io/v2/homebrew/core/jupyterlab/manifests/4.1.6
##################################################################################################################################################################################################### 100.0%
==> Fetching dependencies for jupyterlab: certifi, libyaml, libnghttp2, node, pandoc, libsodium and zeromq
==> Downloading https://ghcr.io/v2/homebrew/core/certifi/manifests/2024.2.2
##################################################################################################################################################################################################### 100.0%
==> Fetching certifi
==> Downloading https://ghcr.io/v2/homebrew/core/certifi/blobs/sha256:09f1aae317be7e27b2650b14dae4588070f8de1c4ecc03856ec238bf28e77ad0
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/manifests/0.2.5
##################################################################################################################################################################################################### 100.0%
==> Fetching libyaml
==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/blobs/sha256:dbd54ce703c6d8eb77e708f75b4730ad2653d28f6291c4a26dc22158beb3f210
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libnghttp2/manifests/1.61.0
##################################################################################################################################################################################################### 100.0%
==> Fetching libnghttp2
==> Downloading https://ghcr.io/v2/homebrew/core/libnghttp2/blobs/sha256:3b33bcce665afcc32282b9d44809c3a3634b2bbe853b22933b2ea91554848ca4
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/21.7.2
##################################################################################################################################################################################################### 100.0%
==> Fetching node
==> Downloading https://ghcr.io/v2/homebrew/core/node/blobs/sha256:5c3232765f85b1f087f7b8b5cce3d1ac25c4c020c3e8e983701236f8ad2bce3f
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/pandoc/manifests/3.1.13
##################################################################################################################################################################################################### 100.0%
==> Fetching pandoc
==> Downloading https://ghcr.io/v2/homebrew/core/pandoc/blobs/sha256:18b0d37954b41416dedcc3e8e4dbae1d97048bd674c4415ebf00eb3f6659bba8
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/libsodium/manifests/1.0.19
##################################################################################################################################################################################################### 100.0%
==> Fetching libsodium
==> Downloading https://ghcr.io/v2/homebrew/core/libsodium/blobs/sha256:68ce4512d9bf1e061edd2d0c09c809d7d63ca61a904802a0bf60cb935613c484
##################################################################################################################################################################################################### 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/zeromq/manifests/4.3.5_1
##################################################################################################################################################################################################### 100.0%
==> Fetching zeromq
==> Downloading https://ghcr.io/v2/homebrew/core/zeromq/blobs/sha256:c8c1cafdffdc020cf504bc59888d61a016df6cdfc12650d89a43a846edb77ef2
##################################################################################################################################################################################################### 100.0%
==> Fetching jupyterlab
==> Downloading https://ghcr.io/v2/homebrew/core/jupyterlab/blobs/sha256:d4afac9a6d9463f276d78c0098b667cd61e8d13457f395ae6fb14874c7b33e98
##################################################################################################################################################################################################### 100.0%
==> Installing dependencies for jupyterlab: certifi, libyaml, libnghttp2, node, pandoc, libsodium and zeromq
==> Installing jupyterlab dependency: certifi
==> Downloading https://ghcr.io/v2/homebrew/core/certifi/manifests/2024.2.2
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/02093bb105fb5bd7c9c6d3416050ad730e9bc91e187a0eac203e804168511726--certifi-2024.2.2.bottle_manifest.json
==> Pouring certifi--2024.2.2.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/certifi/2024.2.2: 30 files, 24.6KB
==> Installing jupyterlab dependency: libyaml
==> Downloading https://ghcr.io/v2/homebrew/core/libyaml/manifests/0.2.5
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/5f6b0af1730aa1bc02f8021c90ed7ffe988eeba95eec83e6c828f77332ba6406--libyaml-0.2.5.bottle_manifest.json
==> Pouring libyaml--0.2.5.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/libyaml/0.2.5: 10 files, 331.4KB
==> Installing jupyterlab dependency: libnghttp2
==> Downloading https://ghcr.io/v2/homebrew/core/libnghttp2/manifests/1.61.0
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/84e039765210f9da314a9b989360b06406c6123f9aae7b1a47dd010504d3bcfb--libnghttp2-1.61.0.bottle_manifest.json
==> Pouring libnghttp2--1.61.0.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/libnghttp2/1.61.0: 13 files, 785.5KB
==> Installing jupyterlab dependency: node
==> Downloading https://ghcr.io/v2/homebrew/core/node/manifests/21.7.2
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/5506da4dc87d6679454e60dc30f5a78ad03242d167a9e3fd3ae9629a76f1bc59--node-21.7.2.bottle_manifest.json
==> Pouring node--21.7.2.monterey.bottle.tar.gz
Warning: Cask node was renamed to homebrew/core/node.
🍺  /usr/local/Cellar/node/21.7.2: 2,133 files, 66.0MB
==> Installing jupyterlab dependency: pandoc
==> Downloading https://ghcr.io/v2/homebrew/core/pandoc/manifests/3.1.13
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/abb79dbb75819bc103181d6bb65498de39c7b757269987c87e20604a6f799fe5--pandoc-3.1.13.bottle_manifest.json
==> Pouring pandoc--3.1.13.monterey.bottle.tar.gz
Warning: Cask pandoc was renamed to homebrew/core/pandoc.
🍺  /usr/local/Cellar/pandoc/3.1.13: 10 files, 164.7MB
==> Installing jupyterlab dependency: libsodium
==> Downloading https://ghcr.io/v2/homebrew/core/libsodium/manifests/1.0.19
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/be1ad9f264fab9dfc313d95d9ac7d59ae1774d775801e6f935cf9fe8fe35ab21--libsodium-1.0.19.bottle_manifest.json
==> Pouring libsodium--1.0.19.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/libsodium/1.0.19: 77 files, 1.4MB
==> Installing jupyterlab dependency: zeromq
==> Downloading https://ghcr.io/v2/homebrew/core/zeromq/manifests/4.3.5_1
Already downloaded: /Users/zepeng.yzp/Library/Caches/Homebrew/downloads/27b053a576863f2b2aa214070e5737e3a0ce0a073760d26c39902468274880b1--zeromq-4.3.5_1.bottle_manifest.json
==> Pouring zeromq--4.3.5_1.monterey.bottle.tar.gz
🍺  /usr/local/Cellar/zeromq/4.3.5_1: 84 files, 6.1MB
==> Installing jupyterlab
==> Pouring jupyterlab--4.1.6.monterey.bottle.tar.gz
==> Caveats
Additional kernels can be installed into the shared jupyter directory
  /usr/local/etc/jupyter

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/jupyterlab/4.1.6: 7,708 files, 120.5MB
==> Running `brew cleanup jupyterlab`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Caveats
==> jupyterlab
Additional kernels can be installed into the shared jupyter directory
  /usr/local/etc/jupyter

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
回答: 在Mac使用brew安装Python包可以通过以下步骤进行操作。首先,打开终端,并输入以下命令来安装包管理器Homebrew: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" 接下来,使用brew命令安装Python3: brew install python 安装完成后,可以使用pip来安装Python包。例如,要安装tensorflow,可以使用以下命令: pip install tensorflow 如果在安装过程中遇到了问题,可以尝试更新pip: pip install --upgrade pip 如果还是没有解决问题,可以尝试手动配置Python的外部环境变量。可以通过打开配置文件~/.bash_profile,并写入以下内容来设置环境变量: export PATH=${PATH}:/usr/local/Cellar/python@3.9/3.9.12/bin alias python="/usr/local/Cellar/python@3.9/3.9.12/bin/python3.9" 这样就可以使用brew安装和配置Python包了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [brew安装指定版本的Python / 解决Macbook上Python3.7版本不能安装Tensorflow的问题](https://blog.csdn.net/weixin_39654058/article/details/110015797)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* [Mac使用brew安装Python3.*并设为默认版本](https://blog.csdn.net/u014082714/article/details/123833281)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值