Docker Compose Up给出“系统找不到指定的文件”。错误 [英] Docker Compose Up gives "The system cannot find the file specified." error

查看:75
本文介绍了Docker Compose Up给出“系统找不到指定的文件”。错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在Windows 10计算机上安装了Docker Toolbox。

I have recently installed Docker Toolbox on my Windows 10 machine.

但是,只要我运行 docker-compose up 我收到以下错误消息:

However, whenever I run docker-compose up I get the following error message:

Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "compose\cli\main.py", line 65, in main
  File "compose\cli\main.py", line 117, in perform_command
  File "compose\cli\main.py", line 849, in up
  File "compose\project.py", line 372, in up
  File "compose\project.py", line 539, in warn_for_swarm_mode
  File "site-packages\docker\api\daemon.py", line 33, in info
  File "site-packages\docker\utils\decorators.py", line 47, in inner
  File "site-packages\docker\client.py", line 139, in _get
  File "site-packages\requests\sessions.py", line 488, in get
  File "site-packages\requests\sessions.py", line 475, in request
  File "site-packages\requests\sessions.py", line 596, in send
  File "site-packages\requests\adapters.py", line 423, in send
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 595, in urlopen
  File "site-packages\requests\packages\urllib3\connectionpool.py", line 363, in _make_request
  File "httplib.py", line 1057, in request
  File "httplib.py", line 1097, in _send_request
  File "httplib.py", line 1053, in endheaders
  File "httplib.py", line 897, in _send_output
  File "httplib.py", line 859, in send
  File "site-packages\docker\transport\npipeconn.py", line 31, in connect
  File "site-packages\docker\transport\npipesocket.py", line 22, in wrapped
  File "site-packages\docker\transport\npipesocket.py", line 49, in connect
pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.')
docker-compose returned -1

请注意,我有 C:\Python27 我的 user system 环境变量中的C:\Python27\Scripts 。我也使用Python 3进行了尝试,但仍然无法使用。

Note that I have C:\Python27 and C:\Python27\Scripts in both my user and system environment variables. I also tried this using Python 3, and it still doesn't work.

推荐答案

您和我可能都没有同样的问题。在上面@Haken Lid发布的链接中,问题出在PATH环境变量没有正确版本的Python。

You and I may or may not have the same problem. In the link posted by @Haken Lid above, the issue is with the PATH environment variable not having the correct version of Python.

但是,对我来说,问题是我没有通过运行

BUT, for me, the issue was that I had not set all of my environment variables, by running

eval $(docker-machine env <vmname>)

在运行 docker-compose< any命令>

这篇关于Docker Compose Up给出“系统找不到指定的文件”。错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆