Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

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 !


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...