我有以下停靠文件:
FROM ubuntu:latest
RUN apt-get update \
&& apt-get install -y python3-pip python3-dev \
&& cd /usr/local/bin \
&& ln -s /usr/bin/python3 python3 \
&& pip3 install --upgrade pip
USER root
COPY scripts scripts
RUN ls
RUN pwd
RUN chmod +x ./scripts/functional_test_cli/baft.py
COPY tests tests
RUN pip3 install Pytest
RUN pip3 install pytest-json-report
RUN pip3 install Tavern
RUN pip3 install allure-pytest
RUN pip3 install pytest-pythonpath
RUN pip install --upgrade setuptools
RUN which python
RUN python3 version
CMD ["python3", "./scripts/functional_test_cli/baft.py"]因此,当涉及到这一行时,运行python3版本会引发以下错误:
python: can't open file 'version': [Errno 2] No such file or directory我有遗漏什么吗?为什么不能将python3识别为命令?
发布于 2019-12-13 03:53:36
更改为python3 --version或python3 -V如何?
$ python3 --version
Python 3.7.3
$ python3 -V
Python 3.7.3我认为在python上没有任何命令,只有version。
(它可能看起来像文件引用。多亏了@cricket_007)
$ python3 version
python3: can't open file 'version': [Errno 2] No such file or directory发布于 2019-12-13 03:55:39
如果您想检查安装了哪个版本的python,那么应该是python3 --version。如果不使用破折号执行它,就意味着要运行一个名为"version“的脚本。
发布于 2019-12-13 04:39:49
您可以检查您的python3是否安装了
python3 --version或
python3 -V但是这个错误是因为你的码头恶魔找不到你的bafi.py文件。
https://stackoverflow.com/questions/59315892
复制相似问题