Install PIP while non-root user gives ModuleNotFoundError

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.

Gugmi

Posted 2019-02-06T20:49:08.430

Reputation: 1

Answers

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.

user85954

Posted 2019-02-06T20:49:08.430

Reputation: 11

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. – Scott – 2019-02-26T22:56:07.813