question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Pipenv install fails with "cannot open shared object libffi.so.6"

See original GitHub issue

I’m running pipenv 2018.11.26 under Python 3.7.6 and Pip 20.0.2, under pyenv 1.2.18, with the Arch Linux operating system. Whenever I run pipenv install in this particular repository, it fails immediately. The libffi package in Arch Linux does not provide libffi.so.6; it only provides libffi.so.7. Maybe pipenv is relying on an outdated version of libffi? Has this been fixed in master?

pipenv install --verbose
Pipfile.lock not found, creating…
/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/attr/_make.py:618: RuntimeWarning: Missing ctypes.  Some features like bare super() or accessing __class__ will not work with slots classes.
  set_closure_cell(cell, cls)
Traceback (most recent call last):
  File "/home/jwinnie/.pyenv/versions/3.7.6/bin/pipenv", line 10, in <module>
    sys.exit(cli())
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/cli/command.py", line 254, in install
    editable_packages=state.installstate.editables,
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/core.py", line 1874, in do_install
    keep_outdated=keep_outdated
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/core.py", line 1244, in do_init
    pypi_mirror=pypi_mirror,
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/core.py", line 1035, in do_lock
    dev_packages = project.dev_packages.copy()
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/project.py", line 673, in dev_packages
    return self._build_package_list("dev-packages")
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/project.py", line 221, in _build_package_list
    any(is_installable_file(i) for i in [k, v])
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/project.py", line 221, in <genexpr>
    any(is_installable_file(i) for i in [k, v])
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/utils.py", line 902, in is_installable_file
    from .patched.notpip._internal.utils.packaging import specifiers
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/utils/packaging.py", line 10, in <module>
    from pipenv.patched.notpip._internal import exceptions
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/__init__.py", line 40, in <module>
    from pipenv.patched.notpip._internal.cli.autocompletion import autocomplete
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/cli/autocompletion.py", line 8, in <module>
    from pipenv.patched.notpip._internal.cli.main_parser import create_main_parser
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/cli/main_parser.py", line 12, in <module>
    from pipenv.patched.notpip._internal.commands import (
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/commands/__init__.py", line 6, in <module>
    from pipenv.patched.notpip._internal.commands.completion import CompletionCommand
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/commands/completion.py", line 6, in <module>
    from pipenv.patched.notpip._internal.cli.base_command import Command
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/cli/base_command.py", line 18, in <module>
    from pipenv.patched.notpip._internal.download import PipSession
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/download.py", line 39, in <module>
    from pipenv.patched.notpip._internal.utils.glibc import libc_ver
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv/patched/notpip/_internal/utils/glibc.py", line 3, in <module>
    import ctypes
  File "/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
$ pipenv --support

Pipenv version: '2018.11.26'

Pipenv location: '/home/jwinnie/.pyenv/versions/3.7.6/lib/python3.7/site-packages/pipenv'

Python location: '/home/jwinnie/.pyenv/versions/3.7.6/bin/python3.7'

Python installations found:

  • 3.8.2: /usr/bin/python3.8
  • 3.7.6: /home/jwinnie/.pyenv/versions/3.7.6/bin/python3
  • 3.7.6: /home/jwinnie/.pyenv/versions/3.7.6/bin/python3.7m

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.7.6',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.5.13-zen2-1-zen',
 'platform_system': 'Linux',
 'platform_version': '#1 ZEN SMP PREEMPT Mon, 30 Mar 2020 20:45:45 +0000',
 'python_full_version': '3.7.6',
 'python_version': '3.7',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • PYENV_HOOK_PATH
  • COLORTERM
  • PYENV_SHELL
  • I3SOCK
  • XCURSOR_SIZE
  • EDITOR
  • PYENV_VERSION
  • XDG_SEAT
  • PWD
  • LOGNAME
  • XDG_SESSION_TYPE
  • HOME
  • LANG
  • LS_COLORS
  • STARSHIP_SHELL
  • SWAYSOCK
  • WAYLAND_DISPLAY
  • KITTY_WINDOW_ID
  • INVOCATION_ID
  • SYSTEMD_HOME
  • PYENV_DIR
  • QT_QPA_PLATFORM
  • XDG_SESSION_CLASS
  • TERMINFO
  • TERM
  • USER
  • SDL_VIDEODRIVER
  • DISPLAY
  • SHLVL
  • MOZ_ENABLE_WAYLAND
  • XDG_VTNR
  • XDG_SESSION_ID
  • XDG_RUNTIME_DIR
  • PYENV_ROOT
  • JOURNAL_STREAM
  • PATH
  • DBUS_SESSION_BUS_ADDRESS
  • MAIL
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/jwinnie/.pyenv/versions/3.7.6/bin:/usr/share/pyenv/libexec:/home/jwinnie/.pyenv/shims:/home/jwinnie/.config/nvm/12.16.1/bin:/home/jwinnie/.pyenv/shims:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
  • SHELL: /usr/bin/fish
  • EDITOR: nvim
  • LANG: en_US.UTF-8
  • PWD: /home/jwinnie/code/websuggest-django

Contents of Pipfile (‘/home/jwinnie/code/websuggest-django/Pipfile’):

[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"

[packages]
Django = "*"
django-crispy-forms = "*"
pytz = "*"
django-htmlmin = "*"
django-mathfilters = "*"
requests = "*"
uwsgi = "*"
werkzeug = "*"
django-extensions = "*"
django-webpack-loader = "*"
"maxminddb-geolite2" = "*"
jsonfield = "*"
django-basicauth = "*"
python-dateutil = "*"
dj-database-url = "*"
psycopg2 = "*"

[dev-packages]
"flake8" = "*"
"flake8-mypy" = "*"
"flake8-isort" = "*"

[requires]
python_version = "3.7.6"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

19reactions
tybrscommented, Apr 16, 2020

I had this issue too but then I rebuilt the python version i was using in the pipenv and it worked fine: pyenv install <version> .

16reactions
tybrscommented, Apr 16, 2020

I think what happened is that arch changed its dependencies for libffi so when you upgraded arch packages it likely broke older versions of python built on the older libffi: https://git.archlinux.org/svntogit/packages.git/log/trunk?h=packages/libffi

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ubuntu 20.04 upgrade, Python missing libffi.so.6
I recently upgraded my OS to Ubuntu 20.04 LTS. Now when I try to import a library like Numpy in ...
Read more >
rake libffi.so.6: cannot open shared object file / Newbie Corner ...
Hello! The ruby rake was installed locally with the gem command. Uninstalling the rake gem will remove 63 other of ruby gems from...
Read more >
ImportError: libffi.so.7: cannot open shared object file: No such ...
Running hw.py on the System Environment works correctly (the issue only happens when using the Virtual Environment). A workaround is to find ...
Read more >
ImportError: libffi.so.6: cannot open shared object file: No such ...
When installing a python module, if you see similar error like ImportError: libffi.so.6: cannot open shared object file: No such file or ...
Read more >
libffi.so.6: cannot open shared object file: No such file or ...
Hello. I've installed Maya 2022 on Ubuntu 21.10. Almost everything works great,except Arnold. I'm sure that the error I get it depends about ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found