Perfect solution ModuleNotFoundError: No module named '_bz2' and AttributeError: module 'pandas' has no attribute 'compat' error

I environment: operating system Ubuntu, Python3.7.4

I recently installed pandas when encountered a variety of problems on a virtual machine, prompt an error when importing pandas package. With a variety of information and then find a final solution to the problem.

The first error as above-ModuleNotFoundError: No module named '_bz2', found that access to information is a virtual machine installed Python3.7 not _bz2.cpython-37m-x86_64-linux-gnu.so this file, but you can locate the file in the 3.6 version.

Then I found in the installation directory Python3.6 in the _bz2.cpython-36m-x86_64-linux-gnu.so, then this command will copy files to the corresponding directory in 3.7.4, an error code is not run again a.

But run out or wrong, then it suggests another error AttributeError: module 'pandas' has no attribute 'compat', the author online access to relevant information, has proposed to lower the pandas version, as well as the proposed upgrade version. After reloading the author of several old and new versions, none of this issue is resolved. Later, careful observation errors are found, an error code if pandas.compat.PY37 this line of pandas in __init__.py file, if I try method else commented after all errors are resolved.

Currently did not encounter any other problems in use.

Guess you like

Origin www.cnblogs.com/ikww/p/11544020.html