reloadware / reloadium

Hot Reloading and Profiling for Python
https://reloadium.io
Apache License 2.0
2.74k stars 56 forks source link

Alpine Linux: ModuleNotFoundError: No module named 'reloadium.corium' #163

Open braddotcoffee opened 9 months ago

braddotcoffee commented 9 months ago

Describe the bug

reloadium run fails with ModuleNotFoundError: No module named 'reloadium.corium' when running as a standalone app on Alpine Linux via a Docker container. Python version is 3.11.

To Reproduce

The full use case is for use with hot-reloading in a docker-compose dev environment, but a minimal reproduction is below:

  1. Create a test python file test.py
    def hello_world():
    print("Hello, world!")
  2. Create Docker image using python:3.11.0-alpine image
    
    FROM python:3.11.0-alpine

ENV PIP_ROOT_USER_ACTION=ignore RUN pip install --upgrade pip RUN pip install reloadium

ADD test.py / ENV RW_DEBUG=True

ENTRYPOINT ["reloadium", "run", "test.py"]

```bash
docker build . -t test-reloadium
  1. Start Docker container and see error
    $ docker run test-reloadium
    It seems like your platform or Python version are not supported yet.
    Windows, Linux, macOS and Python 64 bit >= 3.7 (>= 3.9 for M1) <= 3.11 are currently supported.
    Please submit a github issue if you believe Reloadium should be working on your system at
    https://github.com/reloadware/reloadium
    To see the exception run Reloadium with environmental variable RW_DEBUG=True
    Traceback (most recent call last):
    File "/usr/local/bin/reloadium", line 5, in <module>
    from reloadium import start
    File "/usr/local/lib/python3.11/site-packages/reloadium/__init__.py", line 4, in <module>
    pre_import_check()
    File "/usr/local/lib/python3.11/site-packages/reloadium/__utils__.py", line 24, in pre_import_check
    import reloadium.corium
    ModuleNotFoundError: No module named 'reloadium.corium'

Expected behavior

Reloadium should run the file.

Desktop or remote (please complete the following information):**

Additional context

I'm not positive if this is a bug or this is just not supported. I'd love to be able to use this project for hot reloading with docker compose, but cannot figure out what this missing module might be. Thanks for any help!

dkrystki commented 9 months ago

Hey @braddotcoffee Thanks for trying out Reloadium! Alpine docker images are currently not supported but I'm planning to add this in the future. I'll keep this ticket open until it's added.