This is the error: /bin/sh: 1: {python,: not found
I have this code of both C++ and python which are fairly simple and and I just need them to run in the docker.
The C++ code works as it should, yet the python crashes with exit code 127. I’m using docker-compose up --build to build the dockers. any help will be helpful
Below is the code in the Dockerfile:
FROM python:3
COPY requirements.txt .
RUN python -m pip install -r requirements.txt
WORKDIR /app
COPY . /app
CMD {"python", "main.py"}
The code from requirements.txt:
numpy
The code from main.py:
import numpy as np
arr = np.array([1,2,3])
print(arr)
As I’ve said, fairly simple. Just want to mess with docker a little to try and understand it
Please do not share text output as screenshot! Furthermore, you might want to check the output of python-1 log line.
Before you ask questions like “how do i fix it”, make sure to actually add the content of your Dockerfile and your compose file, so we have an idea of what you actually did.
Please, format your post according to the following guide: How to format your forum posts
In short: please, use </> button to share codes, terminal outputs, error messages or anything that can contain special characters which would be interpreted by the MarkDown filter. Use the preview feature to make sure your text is formatted as you would expect it and check your post after you have sent it so you can still fix it.
Example code block:
```
services:
service1:
image: image1
```
After fixing your post, please send a new comment so people are notified about the fixed content.