0

I have to run a python 3 script on a centos 7 host. I've installed python3.8 side by side with python2 so it doesn't break yum.

When I'm running the script I need to run I get this error:

Traceback (most recent call last):
  File "A2PTestSuit.py", line 8, in <module>
    import pandas as pd
  File "/usr/local/lib/python3.8/site-packages/pandas/__init__.py", line 16, in <module>
    raise ImportError(
ImportError: Unable to import required dependencies:
numpy: No module named '_ctypes'

If I list the modules I see that pandas and numpy are installed:

python3 -m pip list
Package         Version
--------------- ----------
certifi         2019.11.28
chardet         3.0.4
DateTime        4.3
idna            2.8
numpy           1.18.1
pandas          0.25.3
pip             19.3.1
python-dateutil 2.8.1
pytz            2019.3
requests        2.22.0
setuptools      41.2.0
six             1.13.0
urllib3         1.25.7
zope.interface  4.7.1

How can I get past this error?

2
  • Another answer - stackoverflow.com/questions/27022373/… - suggests to yum install libffi-devel Commented Jan 13, 2020 at 23:06
  • I've tried that, but it looks like it's already installed: Package libffi-devel-3.0.13-18.el7.x86_64 already installed and lates t version Nothing to do I've installed all the other modules using pip. Can I mix pip and yum module installs like that? Commented Jan 14, 2020 at 14:31

2 Answers 2

1

You can try updating all of your packages in the command line using pip, or just use try: import ... except ImportError: continue

Sign up to request clarification or add additional context in comments.

1 Comment

I fixed it by recompiling with the sudo make -j 8 command. No errors after recompiling with that command.
1

I've got same issue. Problem was solved after I change default interpreter (which was Python 3.8) in PyCharm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.