Skip to content
Advertisement

Dockerfile build image error: Distribution contains no modules or packages for namespace package

I’m trying to build a docker image of a python project. My project has one dependency package, "my_package" which needs to be install first. It’s a namespace package.

I’m having this error when building docker image of this python project. I can pretty much install everything with RUN pip install XYZ inside Dockerfile but I’m not sure what’s the proper way to install local python namespace packages, here, my_package, properly.

I followed this exact same steps on a normal python package that is NOT A NAMESPACE PACKAGE and it works absolutely fine. Any pointers to install python namespace packages in Docker?

Dockerfile:

JavaScript

Docker build command:

JavaScript

Error:

JavaScript

my_package structure:

JavaScript

setup.py:

JavaScript

__init__.py file:

JavaScript

Advertisement

Answer

In your Dockerfile, you need to put :

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement