Solution to pyenv problem

If you get this (or similar) error when running:

/home/peter/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pandas/compat/ UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.

on a Python you have installed using pyenv, it might be that you didnt have all dependencies installed at the time when you installed Python.

Do this:

1) sudo apt-get update


sudo apt-get install –no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev


2) Reinstall your Python


pyenv install X.Y.Z (answer Yes to question about reinstalling)

Problem solved!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.