如何修复错误“错误:命令错误退出状态 1:python。”尝试使用 pip 安装 fitz 模块时?

Posted

技术标签:

【中文标题】如何修复错误“错误:命令错误退出状态 1:python。”尝试使用 pip 安装 fitz 模块时?【英文标题】:How to fix error “ERROR: Command errored out with exit status 1: python.” when trying to install fitz module using pip? 【发布时间】:2020-06-18 00:29:35 【问题描述】:

我正在尝试使用 pip 安装 fitz 模块,但它一直出错。

以下是错误:

    ERROR: Command errored out with exit status 1:
 command: 'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-tmyrjdld\\traits\\setup.py'"'"'; __file__='"'"'C:\\Users\\Public\\Documents\\Wondershare\\CreatorTemp\\pip-install-tmyrjdld\\traits\\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\Public\Documents\Wondershare\CreatorTemp\pip-record-8xivofby\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\traits'
     cwd: C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-tmyrjdld\traits\
Complete output (188 lines):
Reading version file C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-tmyrjdld\traits\traits\version.py
Package version from version file: ('6.0.0', '9349ab9c55f7831b7c8e636d66d8a145b64f6070')
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\traits
copying traits\api.py -> build\lib.win-amd64-3.7\traits
copying traits\base_trait_handler.py -> build\lib.win-amd64-3.7\traits
copying traits\constants.py -> build\lib.win-amd64-3.7\traits
copying traits\ctrait.py -> build\lib.win-amd64-3.7\traits
copying traits\editor_factories.py -> build\lib.win-amd64-3.7\traits
copying traits\has_traits.py -> build\lib.win-amd64-3.7\traits
copying traits\interface_checker.py -> build\lib.win-amd64-3.7\traits
copying traits\traits.py -> build\lib.win-amd64-3.7\traits
copying traits\traits_listener.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_base.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_converters.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_dict_object.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_errors.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_factory.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_handler.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_handlers.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_list_object.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_notifiers.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_numeric.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_set_object.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_type.py -> build\lib.win-amd64-3.7\traits
copying traits\trait_types.py -> build\lib.win-amd64-3.7\traits
copying traits\version.py -> build\lib.win-amd64-3.7\traits
copying traits\__init__.py -> build\lib.win-amd64-3.7\traits
creating build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\adaptation_error.py -> build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\adaptation_manager.py -> build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\adaptation_offer.py -> build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\adapter.py -> build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\api.py -> build\lib.win-amd64-3.7\traits\adaptation
copying traits\adaptation\__init__.py -> build\lib.win-amd64-3.7\traits\adaptation
creating build\lib.win-amd64-3.7\traits\etsconfig
copying traits\etsconfig\api.py -> build\lib.win-amd64-3.7\traits\etsconfig
copying traits\etsconfig\etsconfig.py -> build\lib.win-amd64-3.7\traits\etsconfig
copying traits\etsconfig\__init__.py -> build\lib.win-amd64-3.7\traits\etsconfig
creating build\lib.win-amd64-3.7\traits\testing
copying traits\testing\api.py -> build\lib.win-amd64-3.7\traits\testing
copying traits\testing\doctest_tools.py -> build\lib.win-amd64-3.7\traits\testing
copying traits\testing\nose_tools.py -> build\lib.win-amd64-3.7\traits\testing
copying traits\testing\optional_dependencies.py -> build\lib.win-amd64-3.7\traits\testing
copying traits\testing\unittest_tools.py -> build\lib.win-amd64-3.7\traits\testing
copying traits\testing\__init__.py -> build\lib.win-amd64-3.7\traits\testing
creating build\lib.win-amd64-3.7\traits\tests
copying traits\tests\check_timing.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_abc.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_anytrait_static_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_array.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_array_or_none.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_automatic_adaptation.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_bool.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_callable.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_class_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_clone.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_configure_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_constants.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_container_events.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_copyable_trait_names.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_copy_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_ctraits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_cythonized_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_delegate.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_deprecated_handlers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_dict.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_directory.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_dynamic_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_dynamic_trait_definition.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_editor_factories.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_enum.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_event_order.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_extended_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_extended_trait_change.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_file.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_float.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_float_range.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_get_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_has_required_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_has_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_historical_unpickling.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_integer.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_integer_range.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_interfaces.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_interface_checker.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_int_range_long.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_keyword_args.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_list.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_listeners.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_list_events.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_long_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_new_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_pickle_validated_dict.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_property_delete.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_property_notifications.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_range.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_regression.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_rich_compare.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_special_event_handlers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_static_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_string.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_str_handler.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_sync_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_target.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_base.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_change_event_tracer.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_converters.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_cycle.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_default_initializer.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_exceptions.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_get_set.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_list_dict.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_prefix_list.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_trait_types.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_tuple.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_type.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_ui_notifiers.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_undefined.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_unicode_traits.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_uuid.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_validated_tuple.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_version.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_view_elements.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\test_weak_ref.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\tuple_test_mixin.py -> build\lib.win-amd64-3.7\traits\tests
copying traits\tests\__init__.py -> build\lib.win-amd64-3.7\traits\tests
creating build\lib.win-amd64-3.7\traits\util
copying traits\util\api.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\async_trait_wait.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\camel_case.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\clean_strings.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\deprecated.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\event_tracer.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\home_directory.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\import_symbol.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\resource.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\toposort.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\trait_documenter.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\weakiddict.py -> build\lib.win-amd64-3.7\traits\util
copying traits\util\__init__.py -> build\lib.win-amd64-3.7\traits\util
creating build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\abc_examples.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\benchmark.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\interface_examples.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\lazy_examples.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\test_adaptation_manager.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\test_adaptation_offer.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\test_adapter.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\test_global_adaptation_manager.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
copying traits\adaptation\tests\__init__.py -> build\lib.win-amd64-3.7\traits\adaptation\tests
creating build\lib.win-amd64-3.7\traits\etsconfig\tests
copying traits\etsconfig\tests\test_etsconfig.py -> build\lib.win-amd64-3.7\traits\etsconfig\tests
copying traits\etsconfig\tests\__init__.py -> build\lib.win-amd64-3.7\traits\etsconfig\tests
creating build\lib.win-amd64-3.7\traits\testing\tests
copying traits\testing\tests\test_optional_dependencies.py -> build\lib.win-amd64-3.7\traits\testing\tests
copying traits\testing\tests\test_unittest_tools.py -> build\lib.win-amd64-3.7\traits\testing\tests
copying traits\testing\tests\__init__.py -> build\lib.win-amd64-3.7\traits\testing\tests
creating build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_async_trait_wait.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_camel_case.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_clean_strings.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_deprecated.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_import_symbol.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_message_records.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_record_containers.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_record_events.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_trait_documenter.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\test_weakidddict.py -> build\lib.win-amd64-3.7\traits\util\tests
copying traits\util\tests\__init__.py -> build\lib.win-amd64-3.7\traits\util\tests
creating build\lib.win-amd64-3.7\traits\tests\test-data
creating build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\README -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p0-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p1-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p2-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p3-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p4-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\hipt-t5.2.0-p5-float-ctrait.pkl -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
copying traits\tests\test-data\historical-pickles\generate_pickles.py -> build\lib.win-amd64-3.7\traits\tests\test-data\historical-pickles
running build_ext
building 'traits.ctraits' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------

错误:命令出错,退出状态为 1:'c:\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-tmyrjdld\traits\setup.py'"'"'; 文件='"'"'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-install-tmyrjdld\traits\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' 安装--记录 'C:\Users\Public\Documents\Wondershare\CreatorTemp\pip-record-8xivofby\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\python37\Include\traits' 检查日志以获取完整的命令输出。

【问题讨论】:

这和你遇到的问题一样吗? ***.com/questions/57444207/… 【参考方案1】:

如错误所述,您需要安装 14.0 版本的 c++。在下面的链接下载它,然后再试一次

错误:需要 Microsoft Visual C++ 14.0。使用“Microsoft Visual C++ Build Tools”获取它:https://visualstudio.microsoft.com/downloads/

【讨论】:

我已经安装了 Microsoft Visual 但它仍然显示同样的错误 你可能还没有安装构建工具,见here 抱歉,好像不是这个问题。 here 说它不能在 Python 3.x 上运行,因此请尝试在 2.x 上运行。请注意,它建议在 anaconda 发行版上运行,您可以考虑。 在这种情况下,您别无选择,只能通过 anaconda 发行版安装。

以上是关于如何修复错误“错误:命令错误退出状态 1:python。”尝试使用 pip 安装 fitz 模块时?的主要内容,如果未能解决你的问题,请参考以下文章

如何修复 WordPress 中的 HTTP 错误

如何修复 Ubuntu 中检测到系统程序错误的问题

如何修复“找不到名称'ClipboardItem'”错误?

如何修复 C++ 中的“分段错误”错误

分段错误错误(信号名称:SIGSEGV)的原因是啥,我将如何找到/修复它?

如何修复以下错误? [复制]