2023-07-12
Mac Python Cassandraセットアップ
pyenv
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp) took 3m12s
❯ brew install pyenv
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp) took 3m12s
❯ pyenv -v
pyenv 2.3.22
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ echo 'eval "$(pyenv init -)"' >> ~/.zshrc
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ source ~/.zshrc
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ pyenv install 3.11.4
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ pyenv global 3.11.4
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ python --version
Python 3.11.4
venv
amanokokorotarou🙃 ~/Project/Python on ☁️ (jp)
❯ mkdir python-cassandra
amanokokorotarou🙃 ~/Project/Python on ☁️ (jp)
❯ cd python-cassandra/
amanokokorotarou🙃 ~/Project/Python/python-cassandra on ☁️ (jp)
❯ python -m venv .venv
Cassandra
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp)
❯ brew install cassandra
amanokokorotarou🙃 ~ via v18.12.1 on ☁️ (jp) took 44s
❯ brew services start cassandra
==> Successfully started `cassandra` (label: homebrew.mxcl.cassandra)
cassandra-draiver
amanokokorotarou🙃 ~/Project/Python/python-cassandra via 🐍 v3.11.4 (.venv) on ☁️ (jp)
❯ pip list
Package Version
---------- -------
pip 23.1.2
setuptools 65.5.0
amanokokorotarou🙃 ~/Project/Python/python-cassandra via 🐍 v3.11.4 (.venv) on ☁️ (jp)
❯ pip install cassandra-driver
Collecting cassandra-driver
Downloading cassandra_driver-3.28.0-cp311-cp311-macosx_11_0_arm64.whl (3.3 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 7.1 MB/s eta 0:00:00
Collecting six>=1.9 (from cassandra-driver)
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting geomet<0.3,>=0.1 (from cassandra-driver)
Downloading geomet-0.2.1.post1-py3-none-any.whl (18 kB)
Collecting click (from geomet<0.3,>=0.1->cassandra-driver)
Downloading click-8.1.4-py3-none-any.whl (98 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.2/98.2 kB 7.4 MB/s eta 0:00:00
Installing collected packages: six, click, geomet, cassandra-driver
Successfully installed cassandra-driver-3.28.0 click-8.1.4 geomet-0.2.1.post1 six-1.16.0
cassandraに実際にデータを登録。