Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'libarchive' #8972

Closed
retsyo opened this issue Jul 21, 2019 · 36 comments
Closed

ModuleNotFoundError: No module named 'libarchive' #8972

retsyo opened this issue Jul 21, 2019 · 36 comments
Labels
locked [bot] locked due to inactivity solver pertains to the solver stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity

Comments

@retsyo
Copy link

retsyo commented Jul 21, 2019

I installed latest Anaconda3-2019.03-Windows-x86_64.exe from https://www.anaconda.com/distribution/ on my windows 7 64 bits

then in the Anaconda Prompt, conda fails to work

(base) C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)>conda install wxpython
Traceback (most recent call last):
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
    module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
  File "f:\Anaconda3_64\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\main_install.py", line 8, in <module>
    from .install import install
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\install.py", line 19, in <module>
    from ..core.index import calculate_channel_urls, get_index
  File "f:\Anaconda3_64\lib\site-packages\conda\core\index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "f:\Anaconda3_64\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "f:\Anaconda3_64\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "f:\Anaconda3_64\Scripts\conda-script.py", line 12, in <module>
    sys.exit(main())
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1354, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1065, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1109, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1120, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "f:\Anaconda3_64\lib\site-packages\conda\exceptions.py", line 1190, in print_unexpected_error_report
    from .cli.main_info import get_env_vars_str, get_main_info_str
  File "f:\Anaconda3_64\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "f:\Anaconda3_64\lib\site-packages\conda\core\index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "f:\Anaconda3_64\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "f:\Anaconda3_64\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'
@retsyo
Copy link
Author

retsyo commented Jul 21, 2019

then I try to use pip to install libarchive, but it still does not work

(base) C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)>pip install wxpython
Collecting wxpython
  Downloading https://files.pythonhosted.org/packages/d0/8e/2c72bc3624e5cee50aa94f8ae8756bc1c3aec96e8d456b6aa1242e92e9e8/wxPython-4.0.6-cp37-cp37m-win_amd64.whl (22.9MB)
    5% |██                              | 1.2MB 12kB/s eta 0:28:57
Operation cancelled by user

(base) C:\Users\USER\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)>pip install libarchive
Collecting libarchive
  Using cached https://files.pythonhosted.org/packages/bf/d4/26f5c9835d4d648e4f22b5fb91288457698e928aaf9d4ab7eff405b7ef03/libarchive-0.4.7.tar.gz
Requirement already satisfied: nose in e:\prg\py\anaconda3_64\lib\site-packages (from libarchive) (1.3.7)
Building wheels for collected packages: libarchive
  Building wheel for libarchive (setup.py) ... error
  Complete output from command e:\prg\py\Anaconda3_64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-588lrxq0\\libarchive\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\USER\AppData\Local\Temp\pip-wheel-d7mn23ay --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib
  creating build\lib\libarchive
  copying libarchive\exception.py -> build\lib\libarchive
  copying libarchive\library.py -> build\lib\libarchive
  copying libarchive\log.py -> build\lib\libarchive
  copying libarchive\public.py -> build\lib\libarchive
  copying libarchive\test_support.py -> build\lib\libarchive
  copying libarchive\__init__.py -> build\lib\libarchive
  creating build\lib\libarchive\adapters
  copying libarchive\adapters\archive_entry.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_read.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_read_append_filter.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_read_set_format.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_read_support_filter_all.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_read_support_format_all.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_write.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_write_add_filter.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\archive_write_set_format.py -> build\lib\libarchive\adapters
  copying libarchive\adapters\__init__.py -> build\lib\libarchive\adapters
  creating build\lib\libarchive\calls
  copying libarchive\calls\archive_entry.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_general.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_read.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_read_append_filter.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_read_set_format.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_read_support_filter_all.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_read_support_format_all.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_write.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_write_add_filter.py -> build\lib\libarchive\calls
  copying libarchive\calls\archive_write_set_format.py -> build\lib\libarchive\calls
  copying libarchive\calls\__init__.py -> build\lib\libarchive\calls
  creating build\lib\libarchive\constants
  copying libarchive\constants\archive.py -> build\lib\libarchive\constants
  copying libarchive\constants\archive_entry.py -> build\lib\libarchive\constants
  copying libarchive\constants\__init__.py -> build\lib\libarchive\constants
  creating build\lib\libarchive\types
  copying libarchive\types\archive.py -> build\lib\libarchive\types
  copying libarchive\types\archive_entry.py -> build\lib\libarchive\types
  copying libarchive\types\__init__.py -> build\lib\libarchive\types
  running egg_info
  writing libarchive.egg-info\PKG-INFO
  writing dependency_links to libarchive.egg-info\dependency_links.txt
  writing requirements to libarchive.egg-info\requires.txt
  writing top-level names to libarchive.egg-info\top_level.txt
  reading manifest file 'libarchive.egg-info\SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  writing manifest file 'libarchive.egg-info\SOURCES.txt'
  creating build\lib\libarchive\resources
  copying libarchive\resources\README.rst -> build\lib\libarchive\resources
  copying libarchive\resources\requirements.txt -> build\lib\libarchive\resources
  installing to build\bdist.win-amd64\wheel
  running install
  error: [WinError 126] can't find specified module。
  Verifying that the library is accessible.
  Library can not be loaded: [WinError 126] can't find specified module。

  ----------------------------------------
  Failed building wheel for libarchive
  Running setup.py clean for libarchive
Failed to build libarchive
Installing collected packages: libarchive
  Running setup.py install for libarchive ... error
    Complete output from command e:\prg\py\Anaconda3_64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-588lrxq0\\libarchive\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER\AppData\Local\Temp\pip-record-f3_504ne\install-record.txt --single-version-externally-managed --compile:    running install
    error: [WinError 126] can't find specified module。
    Verifying that the library is accessible.
    Library can not be loaded: [WinError 126] can't find specified module。

    ----------------------------------------
Command "e:\prg\py\Anaconda3_64\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\USER\\AppData\\Local\\Temp\\pip-install-588lrxq0\\libarchive\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\USER\AppData\Local\Temp\pip-record-f3_504ne\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-install-588lrxq0\libarchive\

@retsyo
Copy link
Author

retsyo commented Jul 21, 2019

once upon a time, I have an anconda python 3.6.x 64 bits on my windows 7 64 bits, whose conda works great.

But some days ago, when I do a routine update via conda update xxx(sorry I don't remember what is xxx now), conda itself is updated too. Then conda always complain for which I don't remember exactly now, but it perhaps ModuleNotFoundError: No module named 'libarchive'. Since this my anconda python 3.6.x has a bad conda and python 3.6.x is some old, I try to install python 3.7x. This is the case why I met the question in the very first

It seems that pip install wxpython can work. But in the past, on windows7, I found conda can found and installed more python modules than pip does. What happened to conda on windows? If it fails to work, the benifit of anaconda python will lost a lot, which is a big pity

@msarahan
Copy link
Contributor

Please post all of the information requested by the issue template. There has been a lot of changes recently especially with this particular library, and we can't help you without understanding your situation.

@16A0
Copy link

16A0 commented Jul 21, 2019

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "/Users/Barb/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "/Users/Barb/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/Barb/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/Barb/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/Barb/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/Users/Barb/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/Barb/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/Barb/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

$ /Users/Barb/anaconda3/bin/conda info

An unexpected error has occurred. Conda has prepared the above report.

@marcbecc
Copy link

I've had this problem on 2 different computers

@msarahan
Copy link
Contributor

We've done all we can to try to help the update process go smoothly, but we're sorry there are still issues. If you'd like, you can try the pre-release anaconda and miniconda installers:

https://repo.anaconda.com/pkgs/misc/previews/anaconda/2019.07/
https://repo.anaconda.com/pkgs/misc/previews/miniconda/4.7.10/

These start with a known-good configuration including libarchive, and if you have problems with these, it indicates a conflict with other software on your system somehow.

@muhlbach
Copy link

muhlbach commented Jul 25, 2019

I'm having the same issue. I updated using conda update --all and now I can't do anything using conda. The errors I get when I start the terminal are:

`Error processing line 1 of /Users/au457044/anaconda3/lib/python3.7/site-packages/matplotlib-3.0.2-py3.7-nspkg.pth:

  Traceback (most recent call last):
    File "/Users/au457044/anaconda3/lib/python3.7/site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 580, in module_from_spec
  AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored`

Then, trying conda update conda, I get:


`(base) d28234:~ au457044$ conda update conda
Error processing line 1 of /Users/au457044/anaconda3/lib/python3.7/site-packages/matplotlib-3.0.2-py3.7-nspkg.pth:

  Traceback (most recent call last):
    File "/Users/au457044/anaconda3/lib/python3.7/site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
    File "<frozen importlib._bootstrap>", line 580, in module_from_spec
  AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored
Traceback (most recent call last):
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/au457044/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/au457044/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/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main_update.py", line 8, in <module>
    from .install import install
  File "/Users/au457044/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/au457044/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/au457044/anaconda3/bin/conda", line 13, in <module>
    sys.exit(main())
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 150, in main
    return conda_exception_handler(_main, *args, **kwargs)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1354, in conda_exception_handler
    return_value = exception_handler(func, *args, **kwargs)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1065, in __call__
    return self.handle_exception(exc_val, exc_tb)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1109, in handle_exception
    return self.handle_unexpected_exception(exc_val, exc_tb)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1120, in handle_unexpected_exception
    self.print_unexpected_error_report(error_report)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1190, in print_unexpected_error_report
    from .cli.main_info import get_env_vars_str, get_main_info_str
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'`

@muhlbach
Copy link

Error report goes like this:

`(base) d28234:~ au457044$ conda info
Error processing line 1 of /Users/au457044/anaconda3/lib/python3.7/site-packages/matplotlib-3.0.2-py3.7-nspkg.pth:

Traceback (most recent call last):
File "/Users/au457044/anaconda3/lib/python3.7/site.py", line 168, in addpackage
exec(line)
File "", line 1, in
File "", line 580, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored

>>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

Traceback (most recent call last):
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/exceptions.py", line 1062, in __call__
    return func(*args, **kwargs)
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/Users/au457044/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/au457044/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/au457044/anaconda3/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in <module>
    from ..core.index import _supplement_index_with_system
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/core/index.py", line 9, in <module>
    from .package_cache_data import PackageCacheData
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
    from conda_package_handling.api import InvalidArchiveError
  File "/Users/au457044/anaconda3/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in <module>
    from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

$ /Users/au457044/anaconda3/bin/conda info

An unexpected error has occurred. Conda has prepared the above report.`

@mrevow
Copy link

mrevow commented Jul 31, 2019

After doing
conda update conda
I started having the same issue as others in this thread
ModuleNotFoundError: No module named 'libarchive'

I followed the suggestion from @msarahan and installed the preview from https://repo.anaconda.com/pkgs/misc/previews/anaconda/2019.07/

But now I get the error: (On Windows 10)

$ ./conda.exe info

# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\exceptions.py", line 1062, in __call__
        return func(*args, **kwargs)
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
        module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
      File "C:\ProgramData\Anaconda2\lib\importlib\__init__.py", line 37, in import_module
        __import__(name)
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
        from ..core.index import _supplement_index_with_system
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 9, in <module>
        from .package_cache_data import PackageCacheData
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
        from conda_package_handling.api import InvalidArchiveError
      File "C:\ProgramData\Anaconda2\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
        from libarchive.exception import ArchiveError as _LibarchiveArchiveError
      File "C:\ProgramData\Anaconda2\lib\site-packages\libarchive\__init__.py", line 1, in <module>
        from .entry import ArchiveEntry
      File "C:\ProgramData\Anaconda2\lib\site-packages\libarchive\entry.py", line 6, in <module>
        from . import ffi
      File "C:\ProgramData\Anaconda2\lib\site-packages\libarchive\ffi.py", line 48, in <module>
        libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
      File "C:\ProgramData\Anaconda2\lib\ctypes\__init__.py", line 444, in LoadLibrary
        return self._dlltype(name)
      File "C:\ProgramData\Anaconda2\lib\ctypes\__init__.py", line 366, in __init__
        self._handle = _dlopen(self._name, mode)
    WindowsError: [Error 126] The specified module could not be found

`$ C:\ProgramData\Anaconda2\Scripts\conda-script.py info`


An unexpected error has occurred. Conda has prepared the above report.

If submitted, this report will be used by core maintainers to improve
future releases of conda.
Would you like conda to send this report to the core maintainers?

[y/N]: y
Upload successful.

@kerwinxu
Copy link

kerwinxu commented Aug 1, 2019

me too . win 10

@naviat
Copy link

naviat commented Aug 2, 2019

me too, macos mojave

@Ryan-Jellesed
Copy link

Ryan-Jellesed commented Aug 6, 2019

same 👆

Mac os mojave

completely broke conda after doing conda update conda

Now, absolutely zero conda commands work.

@biphasic
Copy link

biphasic commented Aug 7, 2019

Broke on Debian 10:

Traceback (most recent call last):
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/bin/conda", line 13, in
sys.exit(main())
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/cli/main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/exceptions.py", line 1335, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/exceptions.py", line 1046, in call
return self.handle_exception(exc_val, exc_tb)
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/exceptions.py", line 1090, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/exceptions.py", line 1101, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/exceptions.py", line 1171, in print_unexpected_error_report
from .cli.main_info import get_env_vars_str, get_main_info_str
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/cli/main_info.py", line 19, in
from ..core.index import _supplement_index_with_system
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/core/index.py", line 9, in
from .package_cache_data import PackageCacheData
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda/core/package_cache_data.py", line 15, in
from conda_package_handling.api import InvalidArchiveError
File "/home/my_home/Applications/Anaconda/[/home/my_home/Applications/Anaconda]/lib/python3.7/site-packages/conda_package_handling/api.py", line 3, in
from libarchive.exception import ArchiveError as _LibarchiveArchiveError
ModuleNotFoundError: No module named 'libarchive'

@tsoernes
Copy link

tsoernes commented Aug 8, 2019

me too after conda update conda

@TandemElephant
Copy link

I also have the same issue after running conda update keras

@strongyin
Copy link

It's broken after
conda update conda

ImportError: Failed to load libarchive library from %s - are any dependencies missing?Is your environment activated?

@biphasic
Copy link

biphasic commented Aug 14, 2019

Upgrading libarchive like this

pip3 install libarchive -U

at least brought me back to a state in which I could call Conda without seeing stack traces only

@leedrake5
Copy link

leedrake5 commented Aug 18, 2019

Same here. It's broken, and I have no idea what to do. MacOS Mojave

@GalJackson
Copy link

Had this issue after doing conda update -n base -c defaults conda and the only thing that worked for me was making a backup of my environments and reinstalling conda, using this solution:

1. backup environments: `cp -R ~/anaconda/envs/* /somewhere/else`

2. delete anaconda3 (or miniconda3) folder: `rm -rf ~/anaconda3`

3. reinstall anaconda using the latest installer from anaconda.com (say yes when it asks about `conda init`)

4. run `conda update -n base -c defaults conda`

5. run `conda update --all`

6. copy back your environments: `cp -R /somewhere/else ~/anaconda3/envs/`

7. test if your environments still work (mine did without problems)

EDIT: I don't know if there are other things to backup before deleting the anaconda folder, I did it this way and nothing went lost, but i'm not responsible for any data loss on your part.

@leedrake5
Copy link

I was able to solve it by removing my anaconda installation

sudo rm -R ~/anaconda3
and reinstall. Thereafter, everything worked. I did lose my environments however, so GalJackson's approach is better if you need to preserve those.

@remic33
Copy link

remic33 commented Aug 21, 2019

Same problem after conda update spyder

@wangluzhou
Copy link

Same problem after conda update spyder

@AymericFerreira
Copy link

Had this issue after doing conda update -n base -c defaults conda and the only thing that worked for me was making a backup of my environments and reinstalling conda, using this solution:

1. backup environments: `cp -R ~/anaconda/envs/* /somewhere/else`

2. delete anaconda3 (or miniconda3) folder: `rm -rf ~/anaconda3`

3. reinstall anaconda using the latest installer from anaconda.com (say yes when it asks about `conda init`)

4. run `conda update -n base -c defaults conda`

5. run `conda update --all`

6. copy back your environments: `cp -R /somewhere/else ~/anaconda3/envs/`

7. test if your environments still work (mine did without problems)

EDIT: I don't know if there are other things to backup before deleting the anaconda folder, I did it this way and nothing went lost, but i'm not responsible for any data loss on your part.

It works, thank you !

@CA4GitHub
Copy link

Same issue on Windows 10.
Is there still not a better fix than saving environments and reinstalling anaconda?

Seems like quite a few people are experiencing issues.

@24Beast
Copy link

24Beast commented Aug 30, 2019

I am also experiencing same issue on Windows 10.
Updated conda to find that no command is working in conda anymore ! : (

Hope you are able to resolve it soon.
All the best !

@estsaon
Copy link

estsaon commented Aug 31, 2019

Same problem after conda update conda

@Approximetal
Copy link

Approximetal commented Sep 6, 2019

I also got this issue after update conda. Try this solution and it might work.

  1. download miniconda from https://repo.anaconda.com/pkgs/misc/previews/miniconda/4.7.10/ (where msarahan mentioned above).
  2. Install the package. For example my computer system is Ubuntu so I use bash Miniconda3-latest-Linux-x86_64.sh
  3. Use the folder ~/.../miniconda3/lib/python3.7/site-packages replace the corresponding folder in Anaconda3 and overwrite all conflicting files.
  4. Then try conda list, it should work now.

@JonasFreireAlcantara
Copy link

Had this issue after doing conda update -n base -c defaults conda and the only thing that worked for me was making a backup of my environments and reinstalling conda, using this solution:

1. backup environments: `cp -R ~/anaconda/envs/* /somewhere/else`

2. delete anaconda3 (or miniconda3) folder: `rm -rf ~/anaconda3`

3. reinstall anaconda using the latest installer from anaconda.com (say yes when it asks about `conda init`)

4. run `conda update -n base -c defaults conda`

5. run `conda update --all`

6. copy back your environments: `cp -R /somewhere/else ~/anaconda3/envs/`

7. test if your environments still work (mine did without problems)

EDIT: Thank you, you helped me a lot !

@estsaon
Copy link

estsaon commented Sep 8, 2019

Same problem after conda update conda

I have solved this problem on win10 by reinstall conda in its default path (C:\Users<my_username>). Previously I installed my conda in C:\ProgramData. I think it is related to permissions issues.

@tabbal
Copy link

tabbal commented Sep 19, 2019

I'm doing the following to avoid this issue:
conda install -q -y 'conda=4.7.*' 'conda-pack=0.4.*' 'libarchive=3.3.*'
even tho I feel it's not good practice?

@K11K11
Copy link

K11K11 commented Oct 15, 2019

Same issue. Seems like the above solution backing up the envs and then removing and re-installing anaconda works.

@phil-blain
Copy link

I also had the same issue yesterday after conda update conda-smithy (see linked issue above).

@notestaff
Copy link

Seeing same problem. My config is

`(conda-build-env-new-py37) 18:25 [tdsub] $ conda info

 active environment : conda-build-env-new-py37
active env location : /ilya/miniconda3/envs/conda-build-env-new-py37
        shell level : 1
   user config file : /home/ilya/.condarc

populated config files : /home/ilya/.condarc
conda version : 4.8.0
conda-build version : 3.18.9
python version : 3.7.3.final.0
virtual packages : __glibc=2.26
base environment : /ilya/miniconda3 (writable)
channel URLs : https://conda.anaconda.org/broad-viral/linux-64
https://conda.anaconda.org/broad-viral/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
https://conda.anaconda.org/notestaff/linux-64
https://conda.anaconda.org/notestaff/noarch
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
package cache : /ilya/miniconda3/pkgs
/home/ilya/.conda/pkgs
envs directories : /ilya/miniconda3/envs
/home/ilya/.conda/envs
platform : linux-64
user-agent : conda/4.8.0 requests/2.22.0 CPython/3.7.3 Linux/4.14.158-129.185.amzn2.x86_64 amzn/2 glibc/2.26
UID:GID : 1002:1002
netrc file : None
offline mode : False

(conda-build-env-new-py37) 18:28 [tdsub] $
`

@martindurant
Copy link

conda install libarchive -n base -c defaults seemed to solve this for me.

@kalefranz kalefranz added the solver pertains to the solver label Apr 16, 2020
@raphenya
Copy link

I experienced similar error while trying to build a conda recipe, and resolved it by installing conda-build using:

conda install conda-build

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label May 18, 2022
@github-actions github-actions bot added the stale::closed [bot] closed after being marked as stale label Jun 17, 2022
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Jun 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity solver pertains to the solver stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
None yet
Development

No branches or pull requests