0

I am trying to install PIP on a server which I do not have root access. I managed to download get-pip.py using wget https://bootstrap.pypa.io/get-pip.py

Though when I try to run the following: python get-pip.py --user, I receive the following error:

ModuleNotFoundError: No module named '_ctypes'

Some research showed me that I am missing a specific library named libffi, though I am unable to install it because I do not have root access.

Another article suggested that I configure --without-ensurepip, however, I do not know how to go about doing this. Could someone please explain what it means to "configure"?

I am running python 3.7 on an Apache, Bluehost server.

1 Answer 1

1

Here's an example:

mkdir ~/src
wget http://www.python.org/ftp/python/3.7.2/Python-3.7.2.tgz
tar -zxvf Python-3.7.2.tgz
cd Python-3.7.2
./configure --without-ensurepip --prefix=$HOME/.local \
    LDFLAGS="-L$HOME/.local/lib64" CPPFLAGS="-I $HOME/.local/lib/libffi-3.2.1/include"
make
make install

See this answer (by zzart) to Use different Python version with virtualenv on Stack Overflow.

1
  • I assume that that ./configure command is one (long) command.  Please be careful when you copy-and-paste from the terminal; lines longer than 80 characters (i.e., the width of the terminal window) will often be pasted as multiple, separate lines. Commented Feb 26, 2019 at 22:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .