Live coding 1

I just wanted to give more data to see if someone can help me. The environment variables on my machine are:
sdcarr@MacBook-Pro-de-Silvino opt % env

TMPDIR=/var/folders/nb/sc6_k5jn76s2_byxg4c79pt00000gn/T/

__CFBundleIdentifier=com.apple.Terminal

XPC_FLAGS=0x0

TERM=xterm-256color

SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.IVPpTOuthb/Listeners

XPC_SERVICE_NAME=0

TERM_PROGRAM=Apple_Terminal

TERM_PROGRAM_VERSION=444

TERM_SESSION_ID=ED36DC07-B006-41C1-A38C-61199A53BED1

SHELL=/bin/zsh

HOME=/Users/sdcarr

LOGNAME=sdcarr

USER=sdcarr

PATH=/Users/sdcarr/opt/miniconda3/bin:/usr/local/Cellar/macvim/8.0-133/MacVim.app/Contents/bin:/usr/local/Cellar/macvim/8.0-133/MacVim.app/Contents/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/opt/local/bin:/opt/local/sbin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Applications/Little Snitch.app/Contents/Components:~/.dotnet/tools:/Library/Apple/usr/bin:/Users/sdcarr/.cargo/bin

SHLVL=1

PWD=/Users/sdcarr/opt

OLDPWD=/Users/sdcarr/opt

HOMEBREW_PREFIX=/opt/homebrew

HOMEBREW_CELLAR=/opt/homebrew/Cellar

HOMEBREW_REPOSITORY=/opt/homebrew

MANPATH=/opt/homebrew/share/man:/opt/local/share/man:/opt/homebrew/share/man:::

INFOPATH=/opt/homebrew/share/info:/opt/homebrew/share/info:

LANG=es_ES.UTF-8

_=/usr/bin/env

Are you using zsh as shell? In that case there should be something like this in your ~/.zshrc file, so that mamba is added to your path:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/lucasvanwalstijn/mambaforge/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/lucasvanwalstijn/mambaforge/etc/profile.d/conda.sh" ]; then
        . "/Users/lucasvanwalstijn/mambaforge/etc/profile.d/conda.sh"
    else
        export PATH="/Users/lucasvanwalstijn/mambaforge/bin:$PATH"
    fi
fi
unset __conda_setup

if [ -f "/Users/lucasvanwalstijn/mambaforge/etc/profile.d/mamba.sh" ]; then
    . "/Users/lucasvanwalstijn/mambaforge/etc/profile.d/mamba.sh"
fi
# <<< conda initialize <<<

This should be added by your mamba init, see also here:

From which it seems that you might have to do

/(your conda installation path)/bin/mamba init zsh
1 Like

I had the path route wrong. I changed “/Usuarios/sdcarr/opt/miniconda3/bin” to this one “/Users/sdcarr/mambaforge/bin/conda” and everything started to work fine.
I guess I did not clean the previous miniconda3 installation correctly.
Thank you very much !

1 Like

I recently re-visited this session because I switched from Windows to Apple. I summarized my experiences in this blog post: Installing Fast.AI on Apple Silicon

1 Like

I am stuck in a loop - How to stop Fastai downgrading Pytorch (to use CPU) on my local machine(ubuntu)?

Please help. Thankyou

I just wanted to add a gigantic thank you. I got into programming later in life, have been learning it all on my own, and made an utter mess of the Python environment on my old Mac - to the point where, as other students mentioned, the environmental issues were completely in the way of learning actual concepts.

I’m starting over on a brand-new Mac today (Apple M3 Pro, 14.4.1 (23E224)), followed the video and my install went perfectly, with a few adjustments due to the Sept 23 note discouraging use of Mambaforge

Here’s what I did:

Extra steps that were necessary due to the fresh OS.

  • I made a second user on the Mac anyway so I’d feel really free to try anything.
  • Installed Xcode command line tools
  • Installed homebrew for wget
  • Set up git and an ssh key and confirmed connection to github

Then started on Python, following the video

  • Checked the only python was system python at /usr/bin/python
  • Default shell was zsh. I didn’t change it.
  • Opened the shell to edit with nano ~/.zshrc
  • I was a bit confused (and worried) when I went to GitHub - conda-forge/miniforge: A conda-forge distribution. and read “After the release of Miniforge 23.3.1 in August 2023, Miniforge and Mambaforge are essentially identical…That said, if you had to start using one today, we recommend to stick to Miniforge.”
  • Since the live coding video is 2022 and it’s 2024, I decided to go with the Miniforge installer. I’m guessing others have the same question about whether to use Mambaforge or Miniforge, but I couldn’t find an answer.
  • Figured with a fresh OS install there was not much to lose :upside_down_face:
  • In zsh terminal the installer ran with bash Miniforge3-MacOSX-arm64.sh . Is it ok to do this from inside the zsh shell? It updated my .zshrc profile and my shell opens up in (base) environment showing the path /Users/aimluser/miniforge3/bin/python for which python. Looks good!
  • Then I was afraid things would break upon running mamba install blah blah blah commands because I’d used Miniforge, but it’s fine. I think, if I understand correctly, this is because Miniforge contains the Mamba installer.
  • I installed ipython, pytorch, and jupyterlab with mamba install. No errors whatsoever!

I seriously learned more in an hour about smart ways to work intentionally and systematically than I have in years of teaching myself. So grateful!

2 Likes