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

[BUG] uvloop ModuleNotFoundError: No module named 'uvloop' on Ubuntu Docker Image #395

Closed
Mikcl opened this issue Feb 6, 2023 · 1 comment · Fixed by #445
Closed

[BUG] uvloop ModuleNotFoundError: No module named 'uvloop' on Ubuntu Docker Image #395

Mikcl opened this issue Feb 6, 2023 · 1 comment · Fixed by #445
Labels
bug Something isn't working

Comments

@Mikcl
Copy link

Mikcl commented Feb 6, 2023

Description

Running a boilerplate robyn project within an ubuntu docker image on mac m1 fails due to missing uvloop runtime dependency. Able to build the image but an error occurs at runtime.

uvloop is a conditional dependency which does not get installated in this environment.

Expected Behavior

I would expect that, if uvloop is required in my environment that it is installed via pip install robyn. This seems like a bug in the conditional install logic?

Screenshots

docker run 618feeec50d8                             
INFO:robyn:Starting server at 0.0.0.0:1001 
INFO:robyn:Press Ctrl + C to stop 

Process Process-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 315, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.10/dist-packages/multiprocess/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/robyn/processpool.py", line 54, in spawn_process
    loop = initialize_event_loop()
  File "/usr/local/lib/python3.10/dist-packages/robyn/processpool.py", line 21, in initialize_event_loop
    import uvloop
ModuleNotFoundError: No module named 'uvloop'

Environment:

├── Dockerfile
└── src
    └── foo
        ├── __init__.py
        └── app.py
FROM ubuntu:22.04

WORKDIR /workspace

RUN apt-get update -y && \
    apt-get install -y python3.10 python3-pip
    
RUN pip install --no-cache-dir --upgrade robyn

# sansyrox/robyn:pyproject.toml conditional python dependencies not installed :(
# to fix:
# RUN pip install uvloop>=0.17.0


COPY ./src /workspace/

EXPOSE 1001

CMD ["python3.10", "/workspace/foo/app.py", "--log-level=DEBUG"]
  • Host OS:
uname -a
Darwin My-MBP 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:35 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T8101 arm64
  • Within the image:
docker run --rm -it --entrypoint bash  618feeec50d8 
root@0827d3192a02:/workspace# uname -a
Linux 0827d3192a02 5.10.76-linuxkit #1 SMP PREEMPT Mon Nov 8 11:22:26 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
root@0827

[Optional] Additional Context

cat ./src/unus/app.py 
from robyn import Robyn

app = Robyn(__file__)

@app.get("/")
async def h(request):
    return "Hello, world!"

app.start(port=1001, url="0.0.0.0")

@sansyrox
Copy link
Member

sansyrox commented Feb 7, 2023

I just verified this bug. And I was unable to replicate on x86_64 Linux and WSL.

I will try tomorrow with a docker on my arm mac.

arm64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants