Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find opencv-python==4.2.0.3 in docker with base image python:3-slim #3229

Closed
felixgao opened this issue Jun 30, 2021 · 2 comments
Closed

Comments

@felixgao
Copy link

#9 126.4 ERROR: Could not find a version that satisfies the requirement opencv-python==4.2.0.32 (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.14.51, 3.4.14.53, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.2.52, 4.5.2.54)

Dockerfile

FROM python:3-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential gcc libreadline-gplv2-dev libncursesw5-dev openssl \
    libssl-dev libsqlite3-dev tk-dev libgdbm-dev \
    libc6-dev libbz2-dev libffi-dev python3-dev python3-pip \
    libxml2-dev libxslt1-dev zlib1g zlib1g-dev python3-lxml \
    && rm -rf /var/lib/apt/lists/* \
    && mkdir /app

WORKDIR /app

COPY poetry.lock pyproject.toml ./

RUN pip install -U pip \
    && pip install poetry==${POETRY_VERSION} \
    && poetry run pip install --upgrade pip \
    && poetry config virtualenvs.create false \
    && poetry export --without-hashes -f requirements.txt \
    |  poetry run pip install -r /dev/stdin \
    && poetry debug \
    && rm -rf ~/.cache/pypoetry/{cache,artifacts} \
    && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
    # && rm -f requirements.txt \
    && rm -rf /var/lib/apt/lists/*

pyproject.toml

[tool.poetry.dependencies]
python = "^3.7"
paddlepaddle = "^2.1.1"
paddleocr = "^2.0.6"
Flask = "^2.0.1"

[tool.poetry.dev-dependencies]
pytest = "^5.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
@liyantaotop
Copy link

you can pip install opencv_python_* other version . then modify the directory name like this
/usr/local/lib/python3.9/site-packages/opencv_python-4.5.2.54.dist-info to ...opencv_python-4.2.0.3.dist-info .
last pip install again

@paddle-bot-old
Copy link

Since you haven't replied for more than 3 months, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
It is recommended to pull and try the latest code first.
由于您超过三个月未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开(建议先拉取最新代码进行尝试),我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants