pycharm unit test debugging does not work because of libffi.so.5 import failure

Answered

I use pycharm 2019.3.4 version .

The attach to the python debugger does not work  on my pycharm evaluation version  .    (I work with python version 3.7.1)

As soon as I want to debug a unittest , I am getting this failure (ImportError: libffi.so.5)
What is missing in my environment ?

 

Testing started at 11:30 AM ...
/arm/tools/python/python/3.7.1/rhe6-x86_64/bin/python3.7 /arm/scratch/jeaflo01/tools/pycharm/plugins/python/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 39526 --file /arm/scratch/jeaflo01/tools/pycharm/plugins/python/helpers/pycharm/_jb_unittest_runner.py --target TestLink.TestLink.test_linkexistonsametarget
Traceback (most recent call last):
  File "/arm/scratch/jeaflo01/tools/pycharm/plugins/python/helpers/pydev/pydevd.py", line 32, in <module>
    import pydevd_tracing
  File "/arm/scratch/jeaflo01/tools/pycharm-2019.3.4/plugins/python/helpers/pydev/pydevd_tracing.py", line 1, in <module>
    import ctypes
  File "/arm/tools/python/python/3.7.1/rhe6-x86_64/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libffi.so.5: cannot open shared object file: No such file or directory

9 comments
Comment actions Permalink

Does it happen when you debug any test?
For instance, if you right-click some method in your code and do Go To | Test -> Create New Test... and then debug it, does the same error appear?

0
Comment actions Permalink

Hi Sergey,

thanks for your answer.

Yes same issue for test that are created automatically by pycharm . 

running of the test is all right, but the debug got this   libffi.so.5 import failure .

0
Comment actions Permalink

I'm wondering if it's reproducible in a brand new project with a new virtual environment. Could you check it as well?

0
Comment actions Permalink

Hi Sergey ,

Indeed from a brand new project this seems to work fine .

I cannot reproduce the error .

This has something to do with my project … I will try to rule out possibilities..

regards,

Jean

0
Comment actions Permalink

You could switch the project interpreter in your problematic project to the one you use in a new project where you don't have the issue.

If it helps, then there must be something wrong with the interpreter itself.

0
Comment actions Permalink

excellent idea. I will try that .

 

0
Comment actions Permalink

that was a good test to make . 

When I switch on the standard python install of my company , I am getting this error again.

I wonder wow comes I am getting this error with pycharm, but eclipse can debug with the same interpreter without any trouble ?

Do you think this could be a missing package installed on the host running pycharm ?  

 

 

/arm/tools/python/python/3.7.1/rhe6-x86_64/bin/python3.7 /arm/scratch/jeaflo01/tools/pycharm/plugins/python/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 34313 --file /home/jeaflo01/PycharmProjects/test/toto.py
Traceback (most recent call last):
File "/arm/scratch/jeaflo01/tools/pycharm/plugins/python/helpers/pydev/pydevd.py", line 32, in <module>
import pydevd_tracing
File "/arm/scratch/jeaflo01/tools/pycharm-2019.3.4/plugins/python/helpers/pydev/pydevd_tracing.py", line 1, in <module>
import ctypes
File "/arm/tools/python/python/3.7.1/rhe6-x86_64/lib/python3.7/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: libffi.so.5: cannot open shared object file: No such file or directory

Process finished with exit code 1

0
Comment actions Permalink

I can see version 3 of libffi is installed.  
Do I need the version 5?  it does not seem to be referenced on my standard red hat repo. 

 

 

nc-b9-7-3:jeaflo01 > yum info libffi
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Installed Packages
Name : libffi
Arch : i686
Version : 3.0.13
Release : 18.el7
Size : 42 k
Repo : installed
From repo : RedHat-Base
Summary : A portable foreign function interface library
URL : http://sourceware.org/libffi

0
Comment actions Permalink

I will make a request to my IT to get the old libffi.so.5 installed ( 3.0.5 version )  to see if this fixes the issue .

 

0

Please sign in to leave a comment.