macOS环境下为VIM安装YCM自动补全插件时编译出错
前置步骤已按GitHub上的YCM文档完成,在`~/.vim/bundle/YouCompleteMe `路径下执行`python3 install.py`时编译报错。我的运行环境:
macOS 11
Python3.8
iTerm
zsh
前半部分编译信息正常
```
Searching Python 3.8 libraries...
Found Python library: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/config-3.8-darwin/libpython3.8.dylib
Found Python headers folder: /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8
-- The C compiler identification is AppleClang 11.0.3.11030032
-- The CXX compiler identification is AppleClang 11.0.3.11030032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python3: /usr/local/bin/python3 (found suitable version "3.8.2", required range is "3.6...3.10") found components: Interpreter Development Development.Module Development.Embed
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- NOT using libclang, no semantic completion for C/C++/ObjC will be available
-- Using Abseil hash tables
-- NOT using clang-tidy for static analysis.
-- Configuring done
-- Generating done
-- Build files have been written to: /private/var/folders/qc/l0jfp1sj61713yh0dbv52sqw0000gn/T/ycm_build_dv9vtuoy
Building CXX object absl/absl/base/CMakeFiles/absl_log_severity.dir/log_severity.cc.o
Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_if.cc.o
Building CXX object absl/absl/numeric/CMakeFiles/absl_int128.dir/int128.cc.o
Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_format.cc.o
Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_fixed.cc.o
Building CXX object absl/absl/base/CMakeFiles/absl_exponential_biased.dir/internal/exponential_biased.cc.o
Building CXX object absl/absl/base/CMakeFiles/absl_spinlock_wait.dir/internal/spinlock_wait.cc.o
Building CXX object absl/absl/time/CMakeFiles/absl_civil_time.dir/internal/cctz/src/civil_time_detail.cc.o
Linking CXX static library libabsl_spinlock_wait.a
Built target absl_spinlock_wait
Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_impl.cc.o
[ 10%] Linking CXX static library libabsl_exponential_biased.a
[ 10%] Built target absl_exponential_biased
[ 10%] Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_info.cc.o
[ 11%] Linking CXX static library libabsl_log_severity.a
[ 13%] Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_libc.cc.o
[ 13%] Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_lookup.cc.o
[ 13%] Built target absl_log_severity
[ 15%] Building CXX object absl/absl/base/CMakeFiles/absl_raw_logging_internal.dir/internal/raw_logging.cc.o
[ 15%] Linking CXX static library libabsl_civil_time.a
[ 15%] Built target absl_civil_time
[ 16%] Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/time_zone_posix.cc.o
[ 18%] Linking CXX static library libabsl_int128.a
[ 18%] Built target absl_int128
[ 18%] Building CXX object absl/absl/time/CMakeFiles/absl_time_zone.dir/internal/cctz/src/zone_info_source.cc.o
[ 18%] Linking CXX static library libabsl_raw_logging_internal.a
[ 18%] Built target absl_raw_logging_internal
[ 18%] Building CXX object absl/absl/base/CMakeFiles/absl_base.dir/internal/cycleclock.cc.o
[ 20%] Building CXX object absl/absl/base/CMakeFiles/absl_throw_delegate.dir/internal/throw_delegate.cc.o
[ 20%] Building CXX object absl/absl/types/CMakeFiles/absl_bad_optional_access.dir/bad_optional_access.cc.o
[ 20%] Building CXX object absl/absl/types/CMakeFiles/absl_bad_variant_access.dir/bad_variant_access.cc.o
[ 22%] Building CXX object absl/absl/debugging/CMakeFiles/absl_debugging_internal.dir/internal/address_is_readable.cc.o
[ 23%] Building CXX object absl/absl/base/CMakeFiles/absl_base.dir/internal/spinlock.cc.o
[ 23%] Building CXX object absl/absl/debugging/CMakeFiles/absl_debugging_internal.dir/internal/elf_mem_image.cc.o
[ 25%] Building CXX object absl/absl/debugging/CMakeFiles/absl_debugging_internal.dir/internal/vdso_support.cc.o
[ 25%] Building CXX object absl/absl/base/CMakeFiles/absl_base.dir/internal/sysinfo.cc.o
[ 27%] Linking CXX static library libabsl_bad_optional_access.a
[ 27%] Linking CXX static library libabsl_debugging_internal.a
[ 28%] Building CXX object absl/absl/base/CMakeFiles/absl_base.dir/internal/thread_identity.cc.o
[ 30%] Linking CXX static library libabsl_bad_variant_access.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_bad_optional_access.a(bad_optional_access.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_debugging_internal.a(elf_mem_image.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_debugging_internal.a(vdso_support.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_bad_optional_access.a(bad_optional_access.cc.o) has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: libabsl_bad_optional_access.a the table of contents is empty (no object file members in the library define global symbols)
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_debugging_internal.a(elf_mem_image.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_debugging_internal.a(vdso_support.cc.o) has no symbols
[ 30%] Built target absl_bad_optional_access
[ 30%] Built target absl_debugging_internal
[ 30%] Building CXX object absl/absl/base/CMakeFiles/absl_base.dir/internal/unscaledcycleclock.cc.o
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_bad_variant_access.a(bad_variant_access.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_bad_variant_access.a(bad_variant_access.cc.o) has no symbols
warning: /Library/Developer/CommandLineTools/usr/bin/ranlib: warning for library: libabsl_bad_variant_access.a the table of contents is empty (no object file members in the library define global symbols)
[ 30%] Built target absl_bad_variant_access
[ 32%] Building CXX object absl/absl/debugging/CMakeFiles/absl_stacktrace.dir/stacktrace.cc.o
[ 32%] Linking CXX static library libabsl_stacktrace.a
[ 32%] Built target absl_stacktrace
[ 32%] Linking CXX static library libabsl_throw_delegate.a
[ 32%] Built target absl_throw_delegate
[ 33%] Linking CXX static library libabsl_base.a
[ 33%] Built target absl_base
[ 35%] Linking CXX static library libabsl_time_zone.a
[ 37%] Building CXX object absl/absl/debugging/CMakeFiles/absl_demangle_internal.dir/internal/demangle.cc.o
[ 37%] Building CXX object absl/absl/base/CMakeFiles/absl_malloc_internal.dir/internal/low_level_alloc.cc.o
[ 38%] Building CXX object absl/absl/hash/CMakeFiles/absl_city.dir/internal/city.cc.o
[ 38%] Building CXX object absl/absl/hash/CMakeFiles/absl_wyhash.dir/internal/wyhash.cc.o
[ 40%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/utf8.cc.o
[ 40%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/escaping.cc.o
[ 40%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings_internal.dir/internal/ostringstream.cc.o
[ 40%] Built target absl_time_zone
[ 42%] Linking CXX static library libabsl_wyhash.a
[ 42%] Built target absl_wyhash
[ 42%] Linking CXX static library libabsl_city.a
[ 42%] Built target absl_city
[ 44%] Linking CXX static library libabsl_strings_internal.a
[ 44%] Built target absl_strings_internal
[ 45%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/ascii.cc.o
[ 45%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/charconv.cc.o
[ 47%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/internal/charconv_parse.cc.o
[ 47%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/internal/memutil.cc.o
[ 49%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/escaping.cc.o
[ 49%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/internal/charconv_bigint.cc.o
[ 50%] Linking CXX static library libabsl_malloc_internal.a
[ 52%] Linking CXX static library libabsl_demangle_internal.a
[ 52%] Built target absl_malloc_internal
[ 54%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/match.cc.o
[ 54%] Built target absl_demangle_internal
[ 54%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
[ 54%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/numbers.cc.o
[ 55%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/str_cat.cc.o
[ 55%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/str_replace.cc.o
[ 57%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/str_split.cc.o
[ 57%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/string_view.cc.o
[ 59%] Building CXX object absl/absl/strings/CMakeFiles/absl_strings.dir/substitute.cc.o
[ 61%] Linking CXX static library libabsl_graphcycles_internal.a
[ 61%] Built target absl_graphcycles_internal
[ 62%] Linking CXX static library libabsl_strings.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_strings.a(string_view.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: libabsl_strings.a(string_view.cc.o) has no symbols
[ 62%] Built target absl_strings
[ 62%] Building CXX object absl/absl/time/CMakeFiles/absl_time.dir/clock.cc.o
[ 64%] Building CXX object absl/absl/hash/CMakeFiles/absl_hash.dir/internal/hash.cc.o
[ 66%] Building CXX object absl/absl/strings/CMakeFiles/absl_cord.dir/internal/cord_rep_ring.cc.o
[ 66%] Building CXX object absl/absl/strings/CMakeFiles/absl_cord.dir/internal/cord_internal.cc.o
[ 66%] Building CXX object absl/absl/strings/CMakeFiles/absl_cord.dir/cord.cc.o
[ 67%] Building CXX object absl/absl/debugging/CMakeFiles/absl_symbolize.dir/symbolize.cc.o
[ 67%] Building CXX object absl/absl/time/CMakeFiles/absl_time.dir/civil_time.cc.o
[ 69%] Building CXX object absl/absl/time/CMakeFiles/absl_time.dir/duration.cc.o
[ 71%] Linking CXX static library libabsl_hash.a
[ 72%] Linking CXX static library libabsl_symbolize.a
[ 72%] Building CXX object absl/absl/time/CMakeFiles/absl_time.dir/format.cc.o
[ 72%] Built target absl_hash
[ 74%] Building CXX object absl/absl/time/CMakeFiles/absl_time.dir/time.cc.o
[ 74%] Built target absl_symbolize
[ 74%] Linking CXX static library libabsl_time.a
[ 74%] Built target absl_time
[ 74%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/barrier.cc.o
[ 76%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/waiter.cc.o
[ 77%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/blocking_counter.cc.o
[ 79%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/notification.cc.o
[ 79%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/mutex.cc.o
[ 79%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/create_thread_identity.cc.o
[ 81%] Building CXX object absl/absl/synchronization/CMakeFiles/absl_synchronization.dir/internal/per_thread_sem.cc.o
[ 81%] Linking CXX static library libabsl_cord.a
[ 81%] Built target absl_cord
[ 81%] Linking CXX static library libabsl_synchronization.a
[ 81%] Built target absl_synchronization
[ 83%] Building CXX object absl/absl/container/CMakeFiles/absl_hashtablez_sampler.dir/internal/hashtablez_sampler.cc.o
[ 83%] Building CXX object absl/absl/container/CMakeFiles/absl_hashtablez_sampler.dir/internal/hashtablez_sampler_force_weak_definition.cc.o
[ 84%] Linking CXX static library libabsl_hashtablez_sampler.a
[ 84%] Built target absl_hashtablez_sampler
[ 86%] Building CXX object absl/absl/container/CMakeFiles/absl_raw_hash_set.dir/internal/raw_hash_set.cc.o
[ 86%] Linking CXX static library libabsl_raw_hash_set.a
[ 86%] Built target absl_raw_hash_set
[ 86%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierDatabase.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Character.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o
[ 91%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Repository.cpp.o
[ 93%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CodePoint.cpp.o
[ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o
[ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o
[ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Word.cpp.o
[ 96%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o
[ 98%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o
Linking CXX shared library /Users/arthurfu/Documents/GitHub/k-vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.cpython-38-darwin.so
```
最后出现报错:
```
Built target ycm_core
Traceback (most recent call last):
File "setup.py", line 13, in <module>
setup(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 143, in setup
_install_setup_requires(attrs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/__init__.py", line 131, in _install_setup_requires
dist = distutils.core.Distribution(dict(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/dist.py", line 423, in __init__
for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points'
Failed to build regex module.
```
按照网上的很多解决方案仍然出现本报错信息。向大佬们求助,提前感谢!
页:
[1]