Нет модуля с именем «ffi»

#python #windows-10 #gunicorn

Вопрос:

Я пытаюсь запустить сервер gunicorn на своем Windows 10 локально, и я получаю эту ошибку ModuleNotFoundError: Нет модуля с именем «ffi».

Это мой код

 import socketio

sio = socketio.Server()
app = socketio.WSGIApp(sio)

@sio.event
def connect(sid, environ):
    print('connect ', sid)
 

Я запускаю эту команду
gunicorn —темы 50 главная:приложение

   File "C:UsersMr NashAppDataLocalProgramsPythonPython39Scriptsgunicorn-script.py", line 33, in <module>
    sys.exit(load_entry_point('gunicorn==20.1.0', 'console_scripts', 'gunicorn')())
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39Scriptsgunicorn-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libimportlibmetadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libimportlib__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libsite-packagesgunicorn-20.1.0-py3.9.egggunicornappwsgiapp.py", line 9, in <module>
    from gunicorn.app.base import Application
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libsite-packagesgunicorn-20.1.0-py3.9.egggunicornappbase.py", line 11, in <module>
    from gunicorn import util
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libsite-packagesgunicorn-20.1.0-py3.9.egggunicornutil.py", line 8, in <module>
    import fcntl
  File "C:UsersMr NashAppDataLocalProgramsPythonPython39libsite-packagesfcntl.py", line 1, in <module>
    import ffi
ModuleNotFoundError: No module named 'ffi'
 

Ответ №1:

 pip install ffi 
 

должно сработать