我最近尝试在Windows上安装Minicoda3。我从Windows命令提示符下创建了正确的环境变量,并以管理员身份通过anacoda提示符检查了我的python能否正常运行。命令print(“ Hello”)有效。
回到Windows命令提示符时,键入 conda update conda ,然后出现以下错误:
TypeError:LoadLibrary()参数1必须为str,而不是None
更具体地,我的提示如下:
Microsoft Windows [Version 10.0.18362.356]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\Eleni>cd Desktop
C:\Users\Eleni\Desktop>conda update conda
Traceback (most recent call last):
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\exceptions.py", line 1062, in __call__
return func(*args, **kwargs)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\main.py", line 84, in _main
exit_code = do_call(args, p)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\conda_argparse.py", line 80, in do_call
module = import_module(relative_mod, __name__.rsplit('.', 1)[0])
File "C:\Users\Eleni\Miniconda3\lib\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 "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\main_update.py", line 8, in <module>
from .install import install
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\install.py", line 19, in <module>
from ..core.index import calculate_channel_urls, get_index
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\core\index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
from conda_package_handling.api import InvalidArchiveError
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda_package_handling\api.py", line 3, in <module>
from libarchive.exception import ArchiveError as _LibarchiveArchiveError
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\entry.py", line 6, in <module>
from . import ffi
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\ffi.py", line 48, in <module>
libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
File "C:\Users\Eleni\Miniconda3\lib\ctypes\__init__.py", line 434, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Eleni\Miniconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Eleni\Miniconda3\Scripts\conda-script.py", line 12, in <module>
sys.exit(main())
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\exceptions.py", line 1354, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\exceptions.py", line 1065, in __call__
return self.handle_exception(exc_val, exc_tb)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\exceptions.py", line 1109, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\exceptions.py", line 1120, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "C:\Users\Eleni\Miniconda3\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 "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\cli\main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\core\index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda\core\package_cache_data.py", line 15, in <module>
from conda_package_handling.api import InvalidArchiveError
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda_package_handling\api.py", line 7, in <module>
from .tarball import CondaTarBZ2 as _CondaTarBZ2
File "C:\Users\Eleni\Miniconda3\lib\site-packages\conda_package_handling\tarball.py", line 7, in <module>
import libarchive
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\entry.py", line 6, in <module>
from . import ffi
File "C:\Users\Eleni\Miniconda3\lib\site-packages\libarchive\ffi.py", line 48, in <module>
libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
File "C:\Users\Eleni\Miniconda3\lib\ctypes\__init__.py", line 434, in LoadLibrary
return self._dlltype(name)
File "C:\Users\Eleni\Miniconda3\lib\ctypes\__init__.py", line 356, in __init__
self._handle = _dlopen(self._name, mode)
TypeError: LoadLibrary() argument 1 must be str, not None
我尝试卸载并重新安装miniconda,但它不起作用。我需要Miniconda才能安装其他软件。我还观看了一段有关在conda上创建和激活新(空?)环境的视频,但我不明白该建议的用处。 另一个可能有用的问题是,在Windows cmd上询问python时,我得到了:
Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated. Libraries may fail to load. To activate this environment
please see https://conda.io/activation
Type "help", "copyright", "credits" or "license" for more information.
答案 0 :(得分:0)
由于错误而发生此错误。幸运的是,Anaconda团队很可能会在今年内发送更新以解决此问题。直到您可以尝试使用此命令来避免此问题。
conda update python-libarchive-c