简体   繁体   中英

How to solve “exec: \”Python\“: executable file not found in $PATH”: unknown. for simple python script on AWS

I've tried things on the previous questions but none have seemed to work.

When I try to run docker container I receive this error:

docker run ....dkr.ecr.us-west-2.amazonaws.com/....(omitting some information here)        
docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"Python\": executable file not found in $PATH": unknown.

The file exists in the specified path.

Installable

    python-socketio==4.6.0
    fxcmpy==1.2.6
    pandas==1.0.5
    joblib==0.16.0
    DateTime==4.3
    schedule==0.6.0
    matplotlib==3.3.0
    numpy==1.19.1
    scipy==1.5.1
    scikit-learn==0.23.1

docker file:

    FROM python:3

    WORKDIR /usr/src/app

    COPY Final_Classifier_KNN_N=4.pkl .
    COPY my_functions.py .
    COPY KNN_FXCM_ALGO.py .
    COPY installables.txt .

    RUN pip install --no-cache-dir -r installables.txt 

    CMD [ "Python", "./KNN_FXCM_ALGO.py" ]

I have tried to run this container using these commands:

- docker run .dkr.ecr.us-west-2.amazonaws.com/
- docker run -ti .dkr.ecr.us-west-2.amazonaws.com/
- docker run python3 .dkr.ecr.us-west-2.amazonaws.com/

Any help would be appreciated

This is not a docker problem. Unix like OS are case sensitive. This should do the trick.

CMD ["python", "KNN_FXCM_ALGO.py"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM