python教程—Docker composition Up给出“系统无法找到指定的文件”。错误-Python实用宝典

python教程—Docker composition Up给出“系统无法找到指定的文件”。错误

我最近在我的Windows 10机器上安装了Docker工具箱。然而,每当我运行docker- up,我得到以下错误消息:

我最近在我的Windows 10机器上安装了Docker工具箱。

然而,每当我运行docker- up,我得到以下错误消息:

    Traceback (most recent call last): File "<string>", line 3, in <module> File "composeclimain.py", line 65, in main File "composeclimain.py", line 117, in perform_command File "composeclimain.py", line 849, in up File "composeproject.py", line 372, in up File "composeproject.py", line 539, in warn_for_swarm_mode File "site-packagesdockerapidaemon.py", line 33, in info File "site-packagesdockerutilsdecorators.py", line 47, in inner File "site-packagesdockerclient.py", line 139, in _get File "site-packagesrequestssessions.py", line 488, in get File "site-packagesrequestssessions.py", line 475, in request File "site-packagesrequestssessions.py", line 596, in send File "site-packagesrequestsadapters.py", line 423, in send File "site-packagesrequestspackagesurllib3connectionpool.py", line 595, in urlopen File "site-packagesrequestspackagesurllib3connectionpool.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-packagesdockertransportnpipeconn.py", line 31, in connect File "site-packagesdockertransportnpipesocket.py", line 22, in wrapped File "site-packagesdockertransportnpipesocket.py", line 49, in connect pywintypes.error: (2, 'WaitNamedPipe', 'The system cannot find the file specified.') docker-compose returned -1

注意,我的用户系统环境变量中都有C:Python27和C:Python27脚本。我也用python3试过了,但还是不行。

回答

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

但是,对我来说,问题是我没有通过运行设置所有的环境变量

    eval $(docker-machine env <vmname>)

在运行docker-compose < any command >之前。

​Python实用宝典 (pythondict.com)
不只是一个宝典
欢迎关注公众号:Python实用宝典

本文由 Python实用宝典 作者:Python实用宝典 发表,其版权均为 Python实用宝典 所有,文章内容系作者个人观点,不代表 Python实用宝典 对观点赞同或支持。如需转载,请注明文章来源。
0

发表评论