no module name "_ctypes" when trying to pip install
Andrew Henderson
I have no root access.
I followed this tutorial to install python without sudo access.
It worked fine, but then when I try to install a package I get the _ctypes error, which I know is due to the "libffi-dev" package missing (on debian).
I can't install this package, so I downloaded version 3.3 from their ftp servers and built it in python/libffi.
I then set env variables like so:
export LD_LIBRARY_PATH=$HOME/python/libffi/lib64
export LD_RUN_PATH=/$HOME/python/libffi/lib64
export PKG_CONFIG_PATH=$HOME/python/libffi/lib/pkgconfigAfter coming across this thread:
However, my pip install is still not working. How can I get around this? Is there an argument I can specify to pip to use my local version of libffi?
1 Answer
For those who hit this issue and have root access, you may be able to correct by following the instructions below. Otherwise, you may need to contact your Sys Admin.
The issue is likely a missing installation of libffi-dev which can be installed with:
sudo apt install libffi-devNote: You may need to uninstall and re-install python to get this to work. In my case, It would not stick until I re-installed.
3