I want to know what Python versions I could install using the pyenv install command. pyenv versions lists only installed versions and does not appear to have an option to list available versions.
How can I find out what versions of Python I can install with pyenv install?
pyenv accepts a switch to the install command to list available versions: --list, or -l for short:
$ pyenv install -l
Available versions:
2.1.3
2.2.3
2.3.7
2.4.0
2.4.1
2.4.2
...
Before running pyenv install -l, you may need to update pyenv as described here. Otherwise the list may not include the latest versions (thank you #csatt1).
Related
I'm a strong pyenv and poetry user that's beginning to use pipx and looking to learn more about how it works. Specifically, I'd like to understand how it determines which Python version to use when installing.
I've noticed that it seems to search PATH for existing references to applications when you pipx install <package> to make existing installations accessible globally. This, for instance, works well with pyenv where it pipx will find a version of the package you install across any Python versions installed via pyenv.
pipx install cookiecutter
⚠️ Note: cookiecutter was already on your PATH at ~/.pyenv/shims/cookiecutter
installed package cookiecutter 1.7.3, Python 3.9.6
These apps are now globally available
- cookiecutter
done! ✨ 🌟 ✨
But what if it's a package you've never installed before? And there's a package version compatible with 3.6, 3.7, 3.8 – how will it determine with Python version to use when installing this package?
I've found you can provide the Python version PipX should install the package into by providing it as an argument to the install command (see below).
More specifically, when using pyenv, you can switch to the version you desire to install into and then provide $(which python) to automatically provide the path to that python version...
pyenv shell 3.X.X
pipx install <package-name> --python $(which python)
I have installed python by pyenv
$which python
/Users/whitebear/.pyenv/shims/python
$python -V
Python 3.7.9
However in /Users/whitebear/.pyenv/versions/3.7.9/lib/,there is no libboost_python**
So I installed by brew brew install python-boost.
It is installed in /usr/local/Cellar/boost-python3/1.75.0/
However there is only libboost_python39** and libboost_numpy39
My python version is 3.7.9 though.
How can I install boost_python for pyenv the same version??
Please see https://github.com/pyenv/pyenv/issues/585
You need to build boost against the python version you installed in your pyenv
I will accept two possible solutions:
Both versions are installed side by side.
3.7.5 is removed and 3.6.5 is then installed.
For this you can use pyenv.
https://realpython.com/intro-to-pyenv/
If you have installed all packages and dependencies you can install different version like this:
pyenv install -v 3.6.5
According to python.org, Python 3.6.1 was released at the end of March. But:
» pyenv install -l | grep 3\.6\.
3.6.0a1
3.6.0a3
3.6-dev
Why is Python 3.6.1 not yet available in pyenv?
Where can I find documentation about the releases that pyenv supports? (when it was added, what is in progress, ...). The pyenv documentation does not give this information.
Is there a repository for Python releases supported by pyenv? (similar to PyPi)
If you installed pyenv via pyenv installer:
pyenv update
If you installed pyenv via Homebrew
brew upgrade pyenv
If you installed pyenv via Git:
cd $(pyenv root) && git pull
I tried pyenv update but that did not resolve the issue for me.
I had to brew update && brew upgrade pyenv before doing pyenv install 3.6.1
I am on shared hosting and I need to install pip with the correct python version, 2.7. To install pip, I did:
$ easy_install pip
However, after it was installed I get the following:
[dave#web1 lib]$ pip --version
pip 1.0.2 from /home/premiere/dave/financials/lib/pip-1.0.2-py2.7.egg (python 2.4)
How would I re-install pip to work on the python2.7 version, which is also installed on the machine?
[premiered#web1 ~]$ python --version
Python 2.6.6
Which is strange, since it is installing to python2.4.
You may want to create a virtualenv using -p /path/to/python-2.7.binary param, and then activate it. Then all stuff you installed using pip would be correctly into your virtualenv.
If multiple versions of python are installed on the system, then you should invoke the version you want when installing. i.e.
$ python27 easy_install pip
This creates a pip file in your path that contains the specified version of python in the hashBang line.