43

Long story short, I want to install Apache Cassandra on a MacBook Pro with M1 chipset.

In order to install it, one must install other softwares before, one of them being python which must be updated to the latest version. I have followed this tutorial.

This is what terminal shows up when asking about python existing version:

> python --version 
Python 2.7.16

In tutorial they are updating it to 2.7.17, so I try to do the same:

> brew install python@2

and this is the output:

Warning: No available formula or cask with the name "python@2". Did you mean bpython, ipython, jython or cython?
==> Searching for similarly named formulae...
These similarly named formulae were found:
bpython             ipython             jython              cython
To install one of them, run (for example):
  brew install bpython
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching taps on GitHub...
Error: No formulae found in taps.

Any ideas how to overcome this issue?

2 Answers2

101

I could install 2.7.18 on M1.

brew install pyenv
pyenv install 2.7.18

Set the python version.

pyenv global 2.7.18

Export PATH if necessary.

export PATH="$(pyenv root)/shims:${PATH}"

Add if necessary.:

echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc
emragins
  • 4,607
  • 2
  • 33
  • 48
Isanka Wijerathne
  • 3,746
  • 3
  • 26
  • 34
4

Sometimes you will get some errors like missing something if you are using rosetta then run:

arch -arm64 pyenv install 2.7.18
xxx
  • 1,153
  • 1
  • 11
  • 23