Мой код:
Код: Выделить всё
import asyncio
import sys
from websockets.asyncio.server import serve
async def handler(websocket):
while True:
message = await websocket.recv()
print(message)
async def main():
async with serve(handler, "", 8001):
await asyncio.get_running_loop().create_future() # run forever
if __name__ == "__main__":
asyncio.run(main())
Код: Выделить всё
['/Users/taylorwofford/Desktop', '/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages', '/Library/Frameworks/Python.framework/Versions/3.13/lib/python313.zip', '/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13', '/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/lib-dynload']
Код: Выделить всё
taylorwofford@Taylors-Air \~ % cd /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages
taylorwofford@Taylors-Air site-packages % ls
Django-5.1.2.dist-info pip-24.2.dist-info
README.txt sqlparse
asgiref sqlparse-0.5.1.dist-info
asgiref-3.8.1.dist-info websockets
Подробнее здесь: [url]https://stackoverflow.com/questions/79081714/python-is-not-a-package-error-but-its-in-sys-path-and-shows-up-in-pip-list[/url]