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
Related
I want to install Python 3.10.5 (or at least Python >= 3.7.). I followed these instructions:
# Step 1. Install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
# Step 2. Install missing headers for all the Python modules to be built
sudo zypper install readline-devel sqlite3-devel libbz2-devel
# Step 3. Install the desired Python version
pyenv install 3.10.5
until I got to pyenv install 3.10.5:
bscuser#localhost:~> pyenv install 3.10.5
/home/bscuser/.pyenv/plugins/python-build/share/python-build/3.7.13: line 1: prefer_openssl11: command not found
BUILD FAILED (openSUSE 15.3 using python-build 20180424)
I feel like it should be related to this file.
How do I solve this?
Yes, you can. Use pyenv update first then running pyenv install -list you should be able to see versions 3.10.4, 3.10.5, 3.10.6, 3.11.0, even 3.11.1 now
I don't think that's possible.
Running pyenv install -list will give you a list of all possible python versions that can be installed, and it will only go as far as 3.10.4 as of this writing.
here is similar case:
OS: macOS, previously installed old version pyenv 1.2.26
-> pyenv install -l see the latest python version is 3.10-dev, not expected 3.10.x
so need upgrade pyenv to latest version, here pyenv 2.3.3:
on macOS: brew upgrade pyenv
you can refer official doc to install/upgrade to latest pyenv
then can list to latest python 3.10.5+:
> pyenv install --list | grep 3.10
...
3.10.0
3.10-dev
3.10.1
3.10.2
3.10.3
3.10.4
3.10.5
3.10.6
mambaforge-4.10.3-10
miniconda-3.10.1
...
then can use pyenv install 3.10.6 normally:
pyenv install 3.10.6
so, here key point is:
upgrade pyenv to latest version (here pyenv 2.3.3), then pyenv install --list can list/see latest python and install it pyenv install 3.10.6
I wanted to install python 3.10 but that version is not available on pyenv version list.
checked by pyenv install --list.
People suggested to upgrade pyenv that but I do not see help related to updating pyenv.
pyenv isn't really 'installed' in a traditional sense, it's just a git checkout. All you have to do to update is
cd ~/.pyenv
git pull
That also updates the list of available python versions.
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 have Python 3.8 and 3.9 installed via Homebrew:
~ brew list | grep python
python#3.8
python#3.9
I want to use Python 3.9 as my default one with python3 command. I tried the following:
~ brew switch python 3.9
Error: python does not have a version "3.9" in the Cellar.
python's installed versions: 3.8.6
I tried to uninstall Python and reinstall it, but it's used by other packages:
~ brew uninstall python
Error: Refusing to uninstall /usr/local/Cellar/python#3.8/3.8.6
because it is required by glib and php, which are currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies python
How can I use Python 3.9?
There is an Homebrew known issue related to side by side install of Python 3.8 / 3.9. To workaround, following commands should work for you:
brew unlink python#3.9
brew unlink python#3.8
brew link --force python#3.9
Re-opening your terminal or execute command rehash can be required to take account the change.
Use pyenv. It's a software that lets you switch between any and all Python versions installed on your system. To install pyenv, use the following code in the command-line:
curl https://pyenv.run | bash
exec $SHELL
Then find the name of the python version you want to switch to with this:
pyenv versions
And select it with this:
pyenv global <version-name>
In your case, it's most likely named 3.9.0.
Updated MacOs Monterrey
For who are facing this problem add the pyenv path to your ~/.zshrc shell file.
export PATH="/Users/username/.pyenv/shims:${PATH}
eval "$(pyenv init --path)
Run in the terminal:
source ~/.zshrc
Check it out:
python3 --version
Font from the issue on GitHub.
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).