2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

まーたpyenv globalしたpythonのバージョンと実際に使用されてるバージョンが違う

Posted at

どういうこと?

こういうこと

pyenv install 3.13
Downloading Python-3.13.1.tar.xz...
-> https://www.python.org/ftp/python/3.13.1/Python-3.13.1.tar.xz
Installing Python-3.13.1...
Installed Python-3.13.1 to /root/.pyenv/versions/3.13.1
root@b5f1f59af63d:/home/volume/langgraph_demo# pyenv global 3.13.1
root@b5f1f59af63d:/home/volume/langgraph_demo#  python -V
Python 3.11.0
root@b5f1f59af63d:/home/volume/langgraph_demo# pyenv versions
  system
  3.11.0
* 3.13.1 (set by /root/.pyenv/version)

python -vの結果が3.13.1になっていてほしい

いろいろやってみる

まずはパスを調べる

(3.11.0) root@b5f1f59af63d:/home/volume/langgraph_demo# which python
/root/.pyenv/versions/3.11.0/bin/python
(3.11.0) root@b5f1f59af63d:/home/volume/langgraph_demo# which pyenv
/root/.pyenv/bin/pyenv

.pyenv/shims/pythonみたいにshimsの中じゃないんだなとは思ったが、pyenvを向いていそうではある

Pyenvの設定を再度有効化

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

rehashして再度確認

root@b5f1f59af63d:/home/volume/langgraph_demo# pyenv rehash
root@b5f1f59af63d:/home/volume/langgraph_demo# python -V
Python 3.13.1
root@b5f1f59af63d:/home/volume/langgraph_demo# pyenv versions
  system
  3.11.0
* 3.13.1 (set by /root/.pyenv/version)

無事一致した
新規に環境を作っているとときどきこの事象に遭遇するため、根本的に解決したいところ。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?