Skip to content

Can not activate newly installed python #3098

Closed
@srini-x

Description

@srini-x

I followed all the instructions. However, I am not able to activate the python I installed.

  1. Installed dependencies
  2. Install pyenv.
  3. Added the following in ~/.zshrc, ~/.zshenv, ~/.zprofile, ~/.profile, ~/.bashrc.
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
  1. checked with pyenv doctor
  2. Installed python 3.10.14 using env CFLAGS='-O2' PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install -v 3.10.14
  3. Did pyenv rehash after.
  4. Set 3.10.14 as global python using pyenv global 3.10.14
  5. Opened new shell. Also restarted PC.

This is what I see.

~ 
❯ pyenv doctor   
Cloning /home/srini/.pyenv/plugins/pyenv-doctor/bin/.....
Installing python-pyenv-doctor...
Installed python-pyenv-doctor to /tmp/pyenv-doctor.20241028100642.21224/prefix
Congratulations! You are ready to build pythons!

~ 
❯ pyenv version
3.10.14 (set by /home/srini/.pyenv/version)

~ 
❯ pyenv versions
  system
* 3.10.14 (set by /home/srini/.pyenv/version)

~ 
❯ python -V      
Python 3.10.12

~ 
❯ python   
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

~ 
❯ pyenv shell 3.10.14

~ 
❯ python -V          
Python 3.10.12

~ 
❯ python3 -V
Python 3.10.12

~ 
❯ which python3
/home/srini/.pyenv/shims/python3

~ 
❯ which python 
/home/srini/.pyenv/shims/python

My System Details:

~ 
❯ echo $SHELL          
/usr/bin/zsh

~ 
❯ lsb_release -a
No LSB modules are available.
Distributor ID:	Linuxmint
Description:	Linux Mint 21.3
Release:	21.3
Codename:	virginia

~ 
❯ uname -r
5.15.0-124-generic

PATH:

~ 
❯ echo $PATH | awk 'BEGIN {RS=":";ORS="\n"}; {print $0}'                                                                                                         
/usr/local/cuda-12.2/bin
/home/srini/.sdkman/candidates/java/current/bin
/home/srini/.nvm/versions/node/v20.18.0/bin
/home/srini/miniforge3/bin
/home/srini/.pyenv/shims
/home/srini/.pyenv/bin
/home/srini/.pyenv/bin
/home/srini/.local/bin
/home/srini/.pyenv/bin
/home/srini/.cargo/bin
/home/srini/.local/bin
/usr/local/sbin
/usr/local/bin
/usr/sbin
/usr/bin
/sbin
/bin
/usr/games
/usr/local/games
/snap/bin
/home/srini/.local/share/JetBrains/Toolbox/scripts
/home/srini/software/fzf/bin
/opt/nvim-linux64/bin
/opt/cursor
/usr/local/go/bin
/home/srini/go/bin

I even removed pyenv and re-installed it. I am still stuck with system python and not able to activate newly installed python versions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions