Installing python with Pyenv on Ubuntu
I keep running into the same issue (very likely a PEBKAC issue) when setting up pyenv - that of:
Downloading Python-3.12.4.tar.xz...
-> https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tar.xz
Installing Python-3.12.4...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/coeus/.pyenv/versions/3.12.4/lib/python3.12/bz2.py", line 17, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/coeus/.pyenv/versions/3.12.4/lib/python3.12/sqlite3/__init__.py", line 57, in <module>
from sqlite3.dbapi2 import *
File "/home/coeus/.pyenv/versions/3.12.4/lib/python3.12/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ModuleNotFoundError: No module named '_sqlite3'
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
If you run into it too - try installing the following packages:
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev python-tk python3-tk tk-dev libbz2-dev libsqlite3-dev
That should be all the requirements fulfilled - try it again!