How to solve import error for pandas using iPython Notebook on Windows?

I am trying to import pandas when using iPython. My common goal is to use XLwings.

I am on Windows 7 and used Anaconda to install Python, pandas and all the dependencies.

Here is my code:

from pandas import DataFrame 

What gives:

 ImportError Traceback (most recent call last) <ipython-input-7-26dfcabfb474> in <module>() ----> 1 from pandas import DataFrame C:\Users\Accounting\Anaconda\lib\site-packages\pandas\__init__.py in <module>() 11 "pandas from the source directory, you may need to run " 12 "'python setup.py build_ext --inplace' to build the C " ---> 13 "extensions first.".format(module)) 14 15 from datetime import datetime ImportError: C extension: hashtable not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first. 

Can anyone with experience using Python / pandas in iPython on Windows help me figure out how to resolve this error?

In particular, where can I run "python setup.py build_ext --inplace"?

Thanks!

+6
source share
2 answers

As Jeff wrote in the comments:

There is an error in older versions (conda): if you updated pandas while it was in use, it did not update correctly. Try closing all python processes, then

 conda remove pandas conda install pandas 
+6
source

I found that when installing packages (most of Christoph Gohlke) sometimes you need to use "pip install name.whl" (in the correct path to the package) and first add "C: / miscutilities" to the PATH environment variables if it is not installed from packages Anaconda -> Lib -> site. Then some other packages that I used conda.

0
source

Source: https://habr.com/ru/post/989421/


All Articles