Sunday, 31 January 2021

Locally compiled libffi files not getting picked up while recompiling python 3 package

In a situation where I need to locally Install Python 3 and some related packages for enabling the Tkinter setup and use openpyxl to read/write .xlsx files using GUI setup.

  1. First I installed the Python 3.9.1 locally and when I tried doing 'import tkinter', it said unable to find the required modules.

  2. Then installed the tcl and tk libraries locally and recompiled the Python libs as shown below. After this step the Python 3 is installed, then tkinter libs were also being built etc.

    ./configure --prefix=~/installed --with-tcltk-libs=‘-L~/installed/lib’ --with-tcltk-includes=’-I~/installed/include

  3. Next I wanted to locally install openpyxl to read/write into .xlsx files. So I tried installing using pip3 install openpyxl, but it said

    "ModuleNotFoundError: No module named '_ctypes'"

  4. Tried downloading libffi and installed locally. Then tried recompiling the python files using below command.

    ./configure --prefix=~/installed --with-tcltk-libs=‘-L~/installed/lib’ --with-tcltk-includes=‘-I~/installed/include’ LDFLAGS=`pkg-config --libs-only-L~/installed/lib/../lib64 -I~/installed/include

    But it wasn't able to pick up the same and during the make of python files, it says, "Following modules built successfully but were removed because they could not be imported: _ctypes".

So, how to make sure the required/locally installed libffi files gets picked up ? Please provide your suggestions !



from Locally compiled libffi files not getting picked up while recompiling python 3 package

No comments:

Post a Comment