Matt Thomas
Matt Thomas

Reputation: 61

Conda won't update packages

If I try to update any package in conda, regardless of environment, I get an 'image not found' error. Here is the full error message. It just started doing this today, I haven't installed anything new or changed anything that I'm aware of. Anyone know how to fix?

Traceback (most recent call last):
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1079, in __call__
    return func(*args, **kwargs)
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/cli/conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "/Users/matthewthomas/anaconda3/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/cli/main_update.py", line 8, in <module>
    from .install import install
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/cli/install.py", line 19, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 10, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from .path_actions import CacheUrlAction, ExtractPackageAction
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/core/path_actions.py", line 30, in <module>
    from ..gateways.connection.download import download
  File "/Users/matthewthomas/anaconda3/lib/python3.7/site-packages/conda/gateways/connection/download.py", line 13, in <module>
    import ctypes
  File "/Users/matthewthomas/anaconda3/lib/python3.7/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ImportError: dlopen(/Users/matthewthomas/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libffi.6.dylib
  Referenced from: /Users/matthewthomas/anaconda3/lib/python3.7/lib-dynload/_ctypes.cpython-37m-darwin.so
  Reason: image not found


Upvotes: 5

Views: 6545

Answers (5)

Gordon Bean
Gordon Bean

Reputation: 4602

The comment from HereHere on an earlier answer worked perfectly for me. I ran:

conda install -c conda-forge --force-reinstall libffi

in my (base) conda environment and the problem was resolved.

Upvotes: 0

Heapify
Heapify

Reputation: 2891

I came across this issue on my Mac when I updated my conda version. It looks like something gets messed up when you update your conda version. So, I removed my previous installation of Anaconda and reinstalled it and error went away.

I'd say definitely try reinstalling your Anaconda or miniconda first before going down the messy route of installing libffi and what not.

Upvotes: 1

Simba
Simba

Reputation: 27588

It's dependency error caused by libffi. Go to /Users/<user_name>/anaconda3/lib, link existing, higher version libffi as libffi.6.dylib. In my case, this is

ln -s libffi.7.dylib libffi.6.dylib

Upvotes: 9

Patrick Ng
Patrick Ng

Reputation: 76

I had the same issue (on Mac) and took the opportunity to reinstall Miniconda with the following steps. Quick process, works fine now.

  • Delete folder with rm -rf ~/miniconda3.
  • Reinstall using bash installer (pkg installer doesn't seem to be working).
  • Rebuild environments per previous.

Upvotes: 0

wei shi
wei shi

Reputation: 1

use homebrew install libffi

$ brew install libffi
...
For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

then run

$ cp /usr/local/opt/libffi/lib/libffi.6.dylib /Users/matthewthomas/anaconda3/lib/

I fixed mine in this way on macOS 10.15.4

Upvotes: 0

Related Questions