import pandas results in ModuleNotFoundError :_lzma

流过昼夜 提交于 2020-07-04 08:59:26

问题


On Ubuntu 18.04 with python 3.7.3, I'm attempting to import pandas but this fails because it can't find _lzma.

I've verified that _lzma is installed with dpkg:

/usr/lib/python3.7/lib-dynload/_lzma.cpython-37m-x86_64-linux-gnu.so. Oddly, _lzma is not a dependency of pandas (as specified by pip3).


回答1:


I was running into this exact same issue today! I was able to fix it though.

Pandas just put out a new version 0.25.0 on July 18th and changing the version back to 0.24.2 fixed this issue for me.

I hope this works for you too!

link: https://pandas.pydata.org/




回答2:


I have the same issue using pyenv. You don't need to rollback pandas.

To fix import errors, I've removed python:

$ pyenv uninstall 3.7.1

Installed dependencies:

$ sudo apt-get install liblzma-dev

and reinstalled version:

$ pyenv install 3.7.1

More on this dependencies here




回答3:


just upgraded to version 0.25.1 and works well



来源:https://stackoverflow.com/questions/57113269/import-pandas-results-in-modulenotfounderror-lzma

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!