Macでpython3.10.x
のvenv環境をつくる際の備忘録
背景
記事作成時点の最新環境だとpython3.12.x
が使われる。
しかし、python3.10.x
を使いたい場合もある。
install
homebrew
によりpython3.10
をインストールする
brew install python@3.10
python3.10
のvenv
を利用
python3.10 -m venv venv3.10
activate
して、バージョンが3.10.x
になっていればOK
$ source venv3.10/bin/activate
(venv3.10)$ python --version
Python 3.10.14
ubuntu環境でも同様のことをしたい場合、上記に沿ってpyton3.10.x
をインストールすればOK
https://gist.github.com/rutcreate/c0041e842f858ceb455b748809763ddb
sudo apt install python3.10 python3.10-venv python3.10-dev
参考