gpt4 book ai didi

python - docker-compose启动报错cannot import name _thread

转载 作者:太空宇宙 更新时间:2023-11-04 03:03:18 25 4
gpt4 key购买 nike

致所有尝试开始使用 docker-compose 的好伙伴。我正在运行 OS X El Capitan (10.11)。

系统附带 python 2.7。不建议尝试将系统 python 替换为 python 3,因为许多核心系统都依赖于 python 2 库。

在命令行中使用 docker 安装了适用于 Mac 的“Docker”和“docker-compose”。

转到终端:'docker-compose --version' 抛出错误:

    admins-MacBook-Pro-63:~ apil.tamang$ docker-compose --version
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 9, in <module>
load_entry_point('docker-compose==1.8.1', 'console_scripts', 'docker-compose')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Python/2.7/site-packages/compose/cli/main.py", line 17, in <module>
from ..bundle import get_image_digests
File "/Library/Python/2.7/site-packages/compose/bundle.py", line 14, in <module>
from .service import format_environment
File "/Library/Python/2.7/site-packages/compose/service.py", line 31, in <module>
from .parallel import parallel_execute
File "/Library/Python/2.7/site-packages/compose/parallel.py", line 10, in <module>
from six.moves import _thread as thread
ImportError: cannot import name _thread

你是做什么的?仅安装 python3 并不能解决问题!

最佳答案

这解决了我的问题

pip install --upgrade docker-py

.

关于python - docker-compose启动报错cannot import name _thread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40284645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com