Solution for Python3.7 import gevent module error

Recently updated python interpreter 3.7

As a result, gevent was installed, and an error was reported after gevent was imported. The error message is as follows

RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)

Seeing that there are not many posts about this issue, I posted it first.

Just execute the following piece of code.

pip3 install -U --force-reinstall --no-binary :all: gevent

Attach parameter description

-U, --upgrade
Upgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.
--force-reinstall
Reinstall all packages even if they are already up-to-date.
--no-binary <format_control>
Do not use binary packages. Can be supplied multiple times, and each time adds to the existing value. Accepts either :all: to disable all binary packages, :none: to empty the set, or one or more package names with commas between them. Note that some packages are tricky to compile and may fail to install when this option is used on them.

The general meaning of this command is to use a non-binary package to reinstall gevent and its dependencies.

In short, the problem was solved perfectly after executing this command.

The currently installed gevent version and greenlet version are 1.3.5 and 0.4.14 respectively

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *