Skip to content

ModuleNotFoundError: No module named 'flask_pymongo._version' with new Pymongo Version #186

Closed
@winstonc03

Description

@winstonc03

File "/app/config.py", line 77, in
import flask_pymongo
File "/usr/local/lib/python3.10/site-packages/flask_pymongo/init.py", line 41, in
from flask_pymongo._version import version
ModuleNotFoundError: No module named 'flask_pymongo._version'

I'm seeing a module not found error, I've been using this package inside a docker container for a while and haven't had any issues. My other packages are installed correctly.

I've reverted the package version to 2.3.0 and my image builds correctly

I've included the dockerfile below.

# Use an official Python runtime as a base image
FROM python:3.10-slim

WORKDIR /app

COPY . /app

# Install any necessary dependencies specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Make port 5000 available to the world outside this container
EXPOSE 3031

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

Here is my requirements.txt file

flask
flask_cors
flask_restful
requests
flask_pymongo
slack_sdk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions