Skip to content

Pyenv not properly working on Armbian. Possible bug? #121

@lliendo

Description

@lliendo

Hi there,

I'm using Armbian on the Pine RockPro64, uname -a reports:

Linux rockpro64 5.10.60-rockchip64 #21.08.1 SMP PREEMPT Wed Aug 25 18:56:55 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

I've installed pyenv both through the manual instructions (cloning the repo and then updating .bashrc) and also through the installer (using the curl call mentioned in https://github.com/pyenv/pyenv-installer). For both options something weird is happening, and unable to clearly see what the problem is. Here are for the steps that I've done to try to install Python 3.9.0 (after either cloning or doing the curl installation):

  1. Update and reload .bashrc:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
  1. Reopen the terminal so .bashrc settings are refreshed. At this point pyenv seems to be available and env shows (which I believe is correct):
PYENV_ROOT=/home/lucas/.pyenv
PATH=/home/lucas/.pyenv/plugins/pyenv-virtualenv/shims:/home/lucas/.pyenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/sbin:/usr/sbin:/sbin
  1. Install Python 3.9.0:
lucas@rockpro64:~$ pyenv install 3.9.0
Installing Python-3.9.0...
Installed Python-3.9.0 to /home/lucas/.pyenv/versions/3.9.0
  1. Create new virtualenv for Python 3.9.0:
lucas@rockpro64:~$ pyenv virtualenv 3.9.0 sandbox
Looking in links: /tmp/tmpgq78tlhc
Requirement already satisfied: setuptools in /home/lucas/.pyenv/versions/3.9.0/envs/sandbox/lib/python3.9/site-packages (49.2.1)
Requirement already satisfied: pip in /home/lucas/.pyenv/versions/3.9.0/envs/sandbox/lib/python3.9/site-packages (20.2.3)
  1. Run pyenv rehash (just in case)
  2. Activate pyenv environment (the pyenv seems to be activated as the prompt changes displaying the environment name):
lucas@rockpro64:~$ pyenv activate sandbox 
pyenv-virtualenv: prompt changing will be removed from future release. configure `export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
(sandbox) lucas@rockpro64:~$
  1. Run python (fails):
(sandbox) lucas@rockpro64:~$ python
bash: python: command not found
(sandbox) lucas@rockpro64:~$

Unfortunately I don't have another system to keep testing, but not long ago I did this on a fresh Debian installation without issues. I'm also running another machine with FreeBSD and though I've installed pyenv long ago (and is working perfectly) I checked the PATH env variables and are both the same.

Something that I found interesting is that pyenv which python reports:

(sandbox) lucas@rockpro64:~$ pyenv which python
/home/lucas/.pyenv/versions/sandbox/bin/python

And if I run: /home/lucas/.pyenv/versions/sandbox/bin/python of course this works:

Python 3.9.0 (default, Nov 27 2021, 16:31:51) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

I can't see if I've missed something or there's something extra that needs to be done on Armbian. I've looked for information regarding this issue but couldn't find someone having the same or a similar problem.

It looks as if the /home/lucas/.pyenv/versions/sandbox/bin/ path is not exposed to the shell after the environment has been activated (if this is indeed the issue).

Thanks for your time,
Lucas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions