0

I've installed anaconda for python 3.7.4, I wrote this code to check all the libraries version:

print('Python: {}'.format(sys.version))
# scipy
import scipy
print('scipy: {}'.format(scipy.__version__))
# numpy
import numpy
print('numpy: {}'.format(numpy.__version__))
# matplotlib
import matplotlib
print('matplotlib: {}'.format(matplotlib.__version__))
# pandas
import pandas
print('pandas: {}'.format(pandas.__version__))
# scikit-learn
import sklearn
print('sklearn: {}'.format(sklearn.__version__))

And I got this error:

Traceback (most recent call last):
  File "C:\Users\andre\AppData\Roaming\Python\Python37\site-packages\pandas\__init__.py", line 30, in <module>
    from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
  File "C:\Users\andre\AppData\Roaming\Python\Python37\site-packages\pandas\_libs\__init__.py", line 3, in <module>
    from .tslibs import (
  File "C:\Users\andre\AppData\Roaming\Python\Python37\site-packages\pandas\_libs\tslibs\__init__.py", line 3, in <module>
    from .conversion import localize_pydatetime, normalize_date
ModuleNotFoundError: No module named 'pandas._libs.tslibs.conversion'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/andre/Desktop/ML programs/test.py", line 13, in <module>
    import pandas
  File "C:\Users\andre\AppData\Roaming\Python\Python37\site-packages\pandas\__init__.py", line 38, in <module>
    "the C extensions first.".format(module)
ImportError: C extension: No module named 'pandas._libs.tslibs.conversion' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace 
--force' to build the C extensions first.

What I have to do to solve it?

  • 1
    Does this answer your question? [No module named 'pandas.\_libs.tslib'](https://stackoverflow.com/questions/54093020/no-module-named-pandas-libs-tslib) – E. Zeytinci Dec 13 '19 at 20:15
  • @E.Zeytinci It woked, thank you –  Dec 13 '19 at 20:18
  • 1
    That was actually a bad suggestion - you just uninstalled Python on a different (non-Conda) installation. The underlying problem is that Conda doesn't function well if you have multiple versions of Python on your PATH. Check your `PATH` and `PYTHONPATH` environment variables and make sure no other Python interpreters are on there (specifically, you need to remove `C:\Users\andre\AppData\Roamin\Python\Python37` from your `PATH`). – merv Dec 13 '19 at 21:05

0 Answers0