2

I am getting an error when running import feather:

---> 28 from pyarrow.lib import cpu_count, set_cpu_count
     29 from pyarrow.lib import (null, bool_,
     30                          int8, int16, int32, int64,
ImportError: cannot import name 'cpu_count'

Anyone know how to fix this? I have pyarrow installed and up to date, and from what I can tell cpu_count isn't a package I can install.

Luxo_Jr
  • 379
  • 1
  • 3
  • 12
  • have you tried this line directly in a terminal ? is there something before this line that could block the import ? – PRMoureu Jul 03 '17 at 17:58
  • 1
    @PRMoureu: I did try it in the terminal as well. I ended up deleting the package and reinstalling it and that ended up working... Not sure what the exact solution was though. – Luxo_Jr Jul 03 '17 at 18:09
  • I'm having this issue too - deleting package and reinstalling with pip didn't resolve issue for me – andrew Jul 19 '17 at 18:45
  • Only seeing this issue in python 2.7. `import pyarrow` works fine on my python 3.6 installation. – andrew Jul 19 '17 at 18:46
  • @andrew: Try doing your install with `conda install -c conda-forge pyarrow` instead of pip. That's what worked for me. I deleted the entire pyarrow folder from the Anaconda packages directory. – Luxo_Jr Jul 20 '17 at 17:33
  • I'm having the same problem. Found this which appears to be similar - exception generated on the same line of pyarrow. https://issues.apache.org/jira/browse/ARROW-1554 – evan_b Sep 23 '17 at 04:57

1 Answers1

0

This is because Python 2.X does not have cpu_count() function in OS module. But python3 has cpu_count() in its OS module. I recommend you to use either python3 or patch the file with from multiprocessing import cpu_count