1

I have a virtualenv. Inside the virtualenv i want to install some dependencies from a file. My command being

pip intsall -r requirements.txt

I am attaching the terminal error output here. First it downloads all the packages in the requirement but it fails later with the attached message.I suspect something wrong with gevent. Please help me as to what is wrong here and how can it be fixed.

    Collecting backports.ssl-match-hostname (from tornado==4.2.0->flower==0.9.1->-r requirements/requirements.txt (line 60))
Installing collected packages: greenlet, gevent, importlib, MySQL-python, ordereddict, Pillow, psycopg2, pycrypto, PyJWT, simplejson, pymediainfo, python-ldap, requests, thrift, unicodecsv, django-crispy-forms, jdcal, openpyxl, python-mimeparse, six, python-dateutil, django-tastypie, retrying, vertica-python, python-memcached, statsd, django-statsd-mozilla, sqlparse, django-debug-toolbar, logilab-common, astroid, coverage, django-coverage, pylint, django-jenkins, gnureadline, ipython, ipdb, mock, pep8, pyflakes, django-debug-panel, gunicorn, pystache, requests-toolbelt, tlslite, oauthlib, requests-oauthlib, jira, PyYAML, simplemail, simple-salesforce, babel, certifi, backports.ssl-match-hostname, tornado, futures, flower, inmobi-ci-fraud, inmobi-ci-adtemplate, inmobi-ci-arbitrage, inmobi-ci-advertiser, inmobi-ci-bms, inmobi-ci-budget, inmobi-ci, inmobi-ci-bulkuploadmodel, inmobi-ci-commonservices, inmobi-ci-configservice, inmobi-ci-dcp, inmobi-ci-geoservice, inmobi-ci-gpm, inmobi-ci-iam, inmobi-ci-impressionlookup, inmobi-ci-iptargeting, inmobi-ci-metadata, inmobi-ci-platform, inmobi-ci-pricingmodel, inmobi-ci-promocode, inmobi-siteclassification, inmobi-uac, inmobi-ccidmetadata-platform, inmobi-ci-publisher, inmobi-ci-rbac-auth, inmobi-ci-rbac-prov, inmobi-offline, inmobi-planet-dcp, cosmos-inmobi-cbp-service, cosmos-inmobi-iam, audience-segment, cosmos-inmobi-segmentmanager, inmobi-asm, inmobi-ci-demand, site-inclusion-exclusion, com-inmobi-planet-app-concept, app-concept-service, inmobi-ci-trackingpartner, com-inmobi-geo-thrift-lis, inmobi-supply-template-platform, inmobi-ci-iam-auth, inmobi-planet-reseller, inmobi-demand-core-rpc
  Found existing installation: greenlet 0.4.13
    Uninstalling greenlet-0.4.13:
      Successfully uninstalled greenlet-0.4.13
  Found existing installation: gevent 1.2.2
    Uninstalling gevent-1.2.2:
      Successfully uninstalled gevent-1.2.2
  Running setup.py install for gevent ... error
    Complete output from command /Users/sourav.prem/cosmos/cosmosenv/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-muEt66/gevent/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zjChux-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sourav.prem/cosmos/cosmosenv/include/site/python2.7/gevent:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.12-intel-2.7
    creating build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/__init__.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/backdoor.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/baseserver.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/coros.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/dns.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/event.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/greenlet.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/http.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/httplib.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/hub.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/local.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/monkey.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/pool.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/pywsgi.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/queue.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/rawgreenlet.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/select.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/server.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/socket.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/ssl.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/sslold.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/thread.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/timeout.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/util.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/win32util.py -> build/lib.macosx-10.12-intel-2.7/gevent
    copying gevent/wsgi.py -> build/lib.macosx-10.12-intel-2.7/gevent
    running build_ext
    building 'gevent.core' extension
    creating build/temp.macosx-10.12-intel-2.7
    creating build/temp.macosx-10.12-intel-2.7/gevent
    cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c gevent/core.c -o build/temp.macosx-10.12-intel-2.7/gevent/core.o
    gevent/core.c:2750:47: error: no member named 'ev_flags' in 'struct event'
      __pyx_t_1 = PyInt_FromLong(__pyx_v_self->ev.ev_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                 ~~~~~~~~~~~~~~~~ ^
    gevent/core.c:2830:36: error: no member named 'ev_flags' in 'struct event'
      __pyx_v_flags = __pyx_v_self->ev.ev_flags;
                      ~~~~~~~~~~~~~~~~ ^
    gevent/core.c:6525:34: error: use of undeclared identifier '_EVENT_VERSION'
      __pyx_t_1 = PyBytes_FromString(_EVENT_VERSION); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                     ^
    gevent/core.c:8047:15: warning: implicit declaration of function 'EVBUFFER_LENGTH' is invalid in C99 [-Wimplicit-function-declaration]
        __pyx_r = evbuffer_get_length(__pyx_v_self->__pyx___obj);
                  ^
    gevent/libevent.h:43:29: note: expanded from macro 'evbuffer_get_length'
    #define evbuffer_get_length EVBUFFER_LENGTH
                                ^
    /usr/local/include/event2/buffer_compat.h:110:28: note: expanded from macro 'EVBUFFER_LENGTH'
    #define EVBUFFER_LENGTH(x)      evbuffer_get_length(x)
                                    ^
    gevent/libevent.h:43:29: note: expanded from macro 'evbuffer_get_length'
    #define evbuffer_get_length EVBUFFER_LENGTH
                                ^
    gevent/core.c:8047:15: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    gevent/libevent.h:43:29: note: expanded from macro 'evbuffer_get_length'
    #define evbuffer_get_length EVBUFFER_LENGTH
                                ^
    /usr/local/include/event2/buffer_compat.h:110:28: note: expanded from macro 'EVBUFFER_LENGTH'
    #define EVBUFFER_LENGTH(x)      evbuffer_get_length(x)
                                    ^
    gevent/libevent.h:43:29: note: expanded from macro 'evbuffer_get_length'
    #define evbuffer_get_length EVBUFFER_LENGTH
                                ^
    2 warnings and 3 errors generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
  Rolling back uninstall of gevent
Command "/Users/sourav.prem/cosmos/cosmosenv/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-muEt66/gevent/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-zjChux-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/sourav.prem/cosmos/cosmosenv/include/site/python2.7/gevent" failed with error code 1 in /private/tmp/pip-build-muEt66/gevent/
Sourav Prem
  • 1,063
  • 13
  • 26
  • is the version of gevent you are trying to install supported on Macos? Link: https://github.com/gevent/gevent/issues/974. Remove the version number from requirements.txt if there is no dependency on the version – Siva Kovvuru Mar 13 '18 at 09:25
  • My gevet version is 1.2.2 and as per the comment in the link it should work for version > 1.2.1. – Sourav Prem Mar 13 '18 at 09:47
  • Try to visit this SO answer : https://stackoverflow.com/a/32375743/7478732 – Koleen BP Dec 28 '19 at 18:06

1 Answers1

2

Had a similar issue, upgrading pip worked for me.

pip install --upgrade pip
Emily
  • 101
  • 4