1

I have no root access.

I followed this tutorial http://ernie55ernie.github.io/python/2016/11/11/install-python-packages-for-local-user-without-sudo.html 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/pkgconfig

After coming across this thread: https://www.reddit.com/r/linuxquestions/comments/c5wxh0/help_with_error_on_install_of_python37_from/

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?

Tobiq
  • 2,489
  • 19
  • 38
  • First try `python -c "import _ctypes"` and `python -c "import ctypes"`. Just to exclude `pip` from the problem. – phd Feb 16 '20 at 12:16
  • @phd trying to import either module results in the same `ModuleNotFoundError: No module named '_ctypes'` error – Tobiq Feb 16 '20 at 14:37
  • Then the problem is not in `pip`, it's in Python. You need to recompile the interpreter. – phd Feb 16 '20 at 17:02
  • I got it working in the end @phd – Tobiq Feb 16 '20 at 18:14
  • Glad to here that! – phd Feb 16 '20 at 18:19
  • 1
    @Tobiq, how did you get it working? – Hans Deragon Mar 15 '20 at 22:25
  • 1
    @HansDeragon I had to recompile everything from scratch, making sure my environment variables were correctly configured. I remember my python wasn't installed properly because I hadn't (during installation) specified where I installed my libffi. There were two arguments one beginning with "-L.." and one beginning with "-I...". – Tobiq Mar 17 '20 at 19:09

0 Answers0