How to use pip for pyenv?

When using pyenv, you should be able to set your ‘local’ version in the directory you are working in, and then pip will rely on this version. So in your case: pyenv local 2.7.14 pip install package-name See more on pyenv commands here: https://github.com/pyenv/pyenv/blob/master/COMMANDS.md But I do think the main piece that is missing here … Read more

Pyenv’s python is missing bzip2 module

On Ubuntu 22 LTS Missing Library Problem in Python Installation with Pyenv Before the fix: $> pyenv install 3.11.0 command result: pyenv: /home/user/.pyenv/versions/3.11.0 already exists continue with installation? (y/N) y Downloading Python-3.11.0.tar.xz… -> https://www.python.org/ftp/python/3.11.0/Python-3.11.0.tar.xz Installing Python-3.11.0… WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib? WARNING: The Python readline extension was not … Read more

Install latest python version with pyenv

Since pyenv 2.3.6 (November 2022) it will automatically resolve a prefix version to the latest revision: pyenv install 3.10 Note that, as the link indicates, pyenv uninstall does not do prefix resolution, it needs the full version upfront. You may need to update your pyenv if it’s too old (pyenv -v will tell you the … Read more

Deactivate pyenv in current shell

If you want to use the python version from your system temporarily (until you close your current shell): pyenv shell system https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-shell If you want by default your system’s python pyenv global system https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-global Suppose your shell is currently in the ‘src’ folder and you want src and all its subfolders to use by default … Read more

How do I remove pyenv virtualenvs

Assuming that list came from running pyenv virtualenvs, you should be able to run pyenv uninstall 3.8.2/envs/greenhouse to remove the 3.8.2/envs/greenhouse environment. The environments themselves should be subdirectories of whatever pyenv root returns when you run it. Try doing cd $(pyenv root) and then looking in the versions/ and versions/{version}/envs/ subdirectories. See the documentation for … Read more