After Installing Google Cloud Bigquery Module, if I import the module into python code. I see this warning message. Happening to me in python 3.7.3 Virtualenv.
Tried
On macOS, if you manage your python with pyenv and package with homebrew, you need to install "xz" first:
brew install xz
After installing xz, you can install python 3.8 by (I'm using 3.8.2 as an example:
pyenv install 3.8.2
Above will fix the problem.
If you are using centos
and compile python from source, you can install from following commands
For centos: sudo yum install -y xz-devel
Recompile python from source code
cd Python-3.8*/
./configure --enable-optimizations
sudo make altinstall
On MacOS and pyenv (https://realpython.com/intro-to-pyenv/), I was able to have this warning go away by having xz installed with homebrew. Using version python 3.6.9 as an example
brew install xz && pyenv install 3.6.9
To use installed python, one needs to add this into .bash_profile
eval "$(pyenv init -)"
and start using it by running
pyenv global 3.6.9
If you compile Python from source, you must have the lzma-dev
package installed, or it will not be built into python.
For ubuntu: sudo apt-get install liblzma-dev
For centos: yum install -y xz-devel
Then configure && make && make install
I used other good answers from here and didn't solve the problem (Ubuntu 18.04, Python3.8), still get this warning. Actually there is one more package is needed to be installed to solve the problem:
sudo apt-get install lzma
So the whole pipeline (run in the python source code folder):
sudo apt-get install liblzma-dev
sudo apt-get install lzma
./configure --enable-optimizations
sudo make
sudo make altinstall