Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker Compose Up gives "The system cannot find the file specified." error

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

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 

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.

like image 597
Yahya Uddin Avatar asked Feb 05 '17 12:02

Yahya Uddin


People also ask

How do I validate a docker compose file?

Validating your file now is as simple as docker-compose -f docker-compose. yml config . As always, you can omit the -f docker-compose. yml part when running this in the same folder as the file itself or having the COMPOSE_FILE environment variable pointing to your file.

Where is the Docker compose config file?

The default path for a Compose file is ./docker-compose.yml . Tip: You can use either a .yml or .yaml extension for this file. They both work.


2 Answers

I just forgot to start "Docker for Windows" which resulted in that error.

like image 125
Razze Avatar answered Sep 26 '22 17:09

Razze


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>) 

before I ran the docker-compose <any command>.

like image 20
jenming Avatar answered Sep 23 '22 17:09

jenming