Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime Warning - Greenlet.greenlet size changed??

Tags:

python

I am running a module which can be found here: https://github.com/danieliu/play-scraper

My code inside python file is as follows:

import play_scraper

print(play_scraper.collection(
      collection='TOP_FREE',
      category='COMMUNICATION',
      results=5,
      page=1))

I do not quite follow the error message in the terminal and I am unsure on how to or where to search to proceed forward.

File "app-store-scraper.py", line 1, in <module>
    import play_scraper
ImportError: No module named play_scraper
Sams-MacBook-Air-2:cm-leadgen samframpton$ python3 app-store-scraper.py
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/importlib/_bootstrap.py:219: RuntimeWarning: greenlet.greenlet size changed, may indicate binary incompatibility. Expected 144, got 128
  return f(*args, **kwds)
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/grequests.py:21: MonkeyPatchWarning: Monkey-patching ssl after ssl has already been imported may lead to errors, including RecursionError on Python 3.6. It may also silently lead to incorrect behaviour on Python 3.7. Please monkey-patch earlier. See https://github.com/gevent/gevent/issues/1016. Modules that had direct imports (NOT patched): ['urllib3.util (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/util/__init__.py)', 'urllib3.contrib.pyopenssl (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py)']. 
  curious_george.patch_all(thread=False, select=False)
Traceback (most recent call last):
  File "app-store-scraper.py", line 7, in <module>
    page=1))
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/play_scraper/api.py", line 41, in collection
    return s.collection(collection, category, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/play_scraper/scraper.py", line 394, in collection
    response = send_request('POST', url, data, params)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/play_scraper/utils.py", line 124, in send_request
    allow_redirects=allow_redirects)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py", line 503, in request
    prep.url, proxies, stream, verify, cert
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/sessions.py", line 676, in merge_environment_settings
    env_proxies = get_environ_proxies(url, no_proxy=no_proxy)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/utils.py", line 760, in get_environ_proxies
    if should_bypass_proxies(url, no_proxy=no_proxy):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/requests/utils.py", line 744, in should_bypass_proxies
    bypass = proxy_bypass(parsed.hostname)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2610, in proxy_bypass
    return proxy_bypass_macosx_sysconf(host)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2587, in proxy_bypass_macosx_sysconf
    return _proxy_bypass_macosx_sysconf(host, proxy_settings)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 2560, in _proxy_bypass_macosx_sysconf
    hostIP = socket.gethostbyname(hostonly)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/_socketcommon.py", line 163, in gethostbyname
    return get_hub().resolver.gethostbyname(hostname)
  File "src/gevent/_hub_local.py", line 73, in gevent.__hub_local.get_hub_noargs
  File "src/gevent/_hub_local.py", line 80, in gevent.__hub_local.get_hub_noargs
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gevent/hub.py", line 390, in __init__
    WaitOperationsGreenlet.__init__(self, None, None)
  File "src/gevent/_greenlet_primitives.py", line 42, in gevent.__greenlet_primitives.TrackedRawGreenlet.__init__
SystemError: /Users/sysadmin/build/v3.7.0/Objects/dictobject.c:1439: bad argument to internal function
Sams-MacBook-Air-2:cm-leadgen samframpton$ 

Any help would be greatly appreciated.

like image 778
Sam Frampton Avatar asked Jul 24 '18 10:07

Sam Frampton


2 Answers

For those getting the below error message. You are likely experiencing issues caused by library updates from gevent & greenlet.

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

see below for more detail. https://github.com/gevent/gevent/issues/1260

The reported compatible versions among greenlet gevent gunicorn are (worked for me)

gunicorn==19.9.0
gevent==1.3.4
greenlet==0.4.13

There are others reporting below might also work as well (I have not tested this).

gevent==20.9.0
greenlet==0.4.17
like image 85
pangyuteng Avatar answered Nov 16 '22 03:11

pangyuteng


For windows it get sovled by using : pip install greenlet==0.4.16

like image 20
Vivek Prajapati Avatar answered Nov 16 '22 02:11

Vivek Prajapati