user4108565
user4108565

Reputation:

ModuleNotFoundError: No module named '_ctypes' when installing pip

On my RHEL 7.x system, I have system level python2.7 in /usr/bin and python3.7 in /usr/local/bin. I am trying to install pip for my python3.7 but I get "ModuleNotFoundError: No module named '_ctypes'" error. I did install libffi-devel but the issue still persists.

I installed libffi-devel using yum install libffi-devel I have downloaded the get_pip file from here: sudo wget https://bootstrap.pypa.io/get-pip.py Now when I run sudo /usr/local/bin/python3.7 get-pip.py I get the described error

Also, I tried sudo /usr/local/bin/python3.7 -m ensurepip which gives me the same error.

How can I get pip installed successfully for my python3.7

Upvotes: 3

Views: 15165

Answers (1)

hassanzadeh.sd
hassanzadeh.sd

Reputation: 3471

Install the libffi development package:

sudo apt-get install libffi-dev

and compile again.

Upvotes: 2

Related Questions