python 3.x - Uvicorn dependency issue - Stack Overflow

I want to create a Django webserver capable of handling HTTP requests and WebSocket requests. I am usin

I want to create a Django webserver capable of handling HTTP requests and WebSocket requests. I am using uvicorn so that both types of requests can be handled in the same server instance. Whenever I try to launch my server with the command:

uvicorn core.asgi:application --host 0.0.0.0 --port 8000

I get the error message:

python3.11/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 11, in <module>
import websockets.legacy.handshake 
ModuleNotFoundError: No module named 'websockets.legacy'

Here is my conda file:

name: [env-name]
channels:
  - conda-fe
  - defaults
dependencies:
  - channels
  - python=3.11
  - daphne
  - django
  - djangorestframework
  - uvicorn
  - boto3
  - pip
  - pip:
    - django-cors-headers
    - websockets
    - "uvicorn[standard]"

I'm not sure why this is happening.

I've tried pip installing all of the dependencies, reinstalling the virtual environment, but it always says "Requirement Already Satisfied".

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745106185a4611568.html

相关推荐

  • python 3.x - Uvicorn dependency issue - Stack Overflow

    I want to create a Django webserver capable of handling HTTP requests and WebSocket requests. I am usin

    12小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信