python - Having issues when install mitmproxy through pip -


i having following issue when installing mitmproxy through pip. have tried other fixed related egg error. here on stack overflow. can't install via pip because of egg_info error pip install matplotlib fails: 'cannot build package freetype; "python setup.py egg_info" failed error code 1'

104:bin user129856$ sudo pip install mitmproxy directory '/users/alokchoudhary/library/caches/pip/http' or parent directory not owned current user , cache has been disabled. please check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. directory '/users/alokchoudhary/library/caches/pip/http' or parent directory not owned current user , cache has been disabled. please check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. collecting mitmproxy /library/python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.   insecureplatformwarning   downloading mitmproxy-0.12.1.tar.gz (6.5mb)     100% |████████████████████████████████| 6.5mb 18kb/s  collecting pyperclip>=1.5.8 (from mitmproxy)   downloading pyperclip-1.5.11.zip collecting pyasn1>0.1.2 (from mitmproxy)   downloading pyasn1-0.1.8.tar.gz (75kb)     100% |████████████████████████████████| 77kb 827kb/s  collecting tornado>=4.0.2 (from mitmproxy)   downloading tornado-4.2.tar.gz (433kb)     100% |████████████████████████████████| 434kb 260kb/s  collecting lxml>=3.3.6 (from mitmproxy)   downloading lxml-3.4.4.tar.gz (3.5mb)     100% |████████████████████████████████| 3.5mb 32kb/s  collecting netlib<0.13,>=0.12 (from mitmproxy)   downloading netlib-0.12.1.tar.gz (64kb)     100% |████████████████████████████████| 65kb 729kb/s      complete output command python setup.py egg_info:     warning: no files found matching 'openssl/rationale'     warning: no previously-included files found matching 'leakcheck'     warning: no previously-included files matching '*.py' found under directory 'leakcheck'     warning: no previously-included files matching '*.pem' found under directory 'leakcheck'     warning: no previously-included files matching '*.pyc' found anywhere in distribution     no previously-included directories found matching 'doc/_build'     zip_safe flag not set; analyzing archive contents...      installed /private/tmp/pip-build-wohxdq/netlib/.eggs/pyopenssl-0.15.1-py2.7.egg     searching cffi     reading https://pypi.python.org/simple/cffi/     best match: cffi 1.1.2     downloading https://pypi.python.org/packages/source/c/cffi/cffi-1.1.2.tar.gz#md5=ca6e6c45b45caa87aee9adc7c796eaea     processing cffi-1.1.2.tar.gz     writing /tmp/easy_install-_e2qwn/cffi-1.1.2/setup.cfg     running cffi-1.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_e2qwn/cffi-1.1.2/egg-dist-tmp-382exn     c/_cffi_backend.c:13:10: fatal error: 'ffi.h' file not found     #include <ffi.h>              ^     1 error generated.     traceback (most recent call last):       file "<string>", line 20, in <module>       file "/private/tmp/pip-build-wohxdq/netlib/setup.py", line 87, in <module>         "install": cffiinstall,       file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/core.py", line 112, in setup         _setup_distribution = dist = klass(attrs)       file "build/bdist.macosx-10.10-intel/egg/setuptools/dist.py", line 268, in __init__       file "build/bdist.macosx-10.10-intel/egg/setuptools/dist.py", line 313, in fetch_build_eggs       file "build/bdist.macosx-10.10-intel/egg/pkg_resources/__init__.py", line 836, in resolve       file "build/bdist.macosx-10.10-intel/egg/pkg_resources/__init__.py", line 1081, in best_match       file "build/bdist.macosx-10.10-intel/egg/pkg_resources/__init__.py", line 1093, in obtain       file "build/bdist.macosx-10.10-intel/egg/setuptools/dist.py", line 380, in fetch_build_egg       file "build/bdist.macosx-10.10-intel/egg/setuptools/command/easy_install.py", line 629, in easy_install        file "build/bdist.macosx-10.10-intel/egg/setuptools/command/easy_install.py", line 659, in install_item        file "build/bdist.macosx-10.10-intel/egg/setuptools/command/easy_install.py", line 842, in install_eggs        file "build/bdist.macosx-10.10-intel/egg/setuptools/command/easy_install.py", line 1070, in build_and_install        file "build/bdist.macosx-10.10-intel/egg/setuptools/command/easy_install.py", line 1058, in run_setup      distutils.errors.distutilserror: setup script exited error: command 'cc' failed exit status 1      ---------------------------------------- command "python setup.py egg_info" failed error code 1 in /private/tmp/pip-build-wohxdq/netlib 

updated after first response libffi:

after installing libffi, started breaking on libxml. found lxml on pip. , break again , looking libxml :(

104:~ user2368563$ brew install libxml error: no available formula libxml  searching formulae... libxml++    libxml2 libxmlsec1 searching taps... homebrew/versions/libxml278 104:~ user2368563$ brew install libxml2 warning: libxml2-2.9.2 installed  104:bin user2368563$ sudo pip install lxml directory '/users/alokchoudhary/library/caches/pip/http' or parent directory not owned current user , cache has been disabled. please check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. directory '/users/alokchoudhary/library/caches/pip/http' or parent directory not owned current user , cache has been disabled. please check permissions , owner of directory. if executing pip sudo, may want sudo's -h flag. collecting lxml /library/python/2.7/site-packages/pip-7.1.0-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: insecureplatformwarning: true sslcontext object not available. prevents urllib3 configuring ssl appropriately , may cause ssl connections fail. more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.   insecureplatformwarning   downloading lxml-3.4.4.tar.gz (3.5mb)     100% |████████████████████████████████| 3.5mb 116kb/s  installing collected packages: lxml   running setup.py install lxml     complete output command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-bdtxat/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gmvcn9-record/install-record.txt --single-version-externally-managed --compile:     /system/library/frameworks/python.framework/versions/2.7/lib/python2.7/distutils/dist.py:267: userwarning: unknown distribution option: 'bugtrack_url'       warnings.warn(msg)     building lxml version 3.4.4.     building without cython.     using build configuration of libxslt 1.1.28     running install     running build     running build_py     creating build     creating build/lib.macosx-10.10-intel-2.7     creating build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/__init__.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/_elementpath.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/builder.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/cssselect.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/doctestcompare.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/elementinclude.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/sax.py -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/usedoctest.py -> build/lib.macosx-10.10-intel-2.7/lxml     creating build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/__init__.py -> build/lib.macosx-10.10-intel-2.7/lxml/includes     creating build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/__init__.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/builder.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/clean.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/defs.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/diff.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/elementsoup.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/formfill.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/html5parser.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/soupparser.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.10-intel-2.7/lxml/html     creating build/lib.macosx-10.10-intel-2.7/lxml/isoschematron     copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron     copying src/lxml/lxml.etree.h -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.10-intel-2.7/lxml     copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/config.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.10-intel-2.7/lxml/includes     copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.10-intel-2.7/lxml/includes     creating build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources     creating build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/rng     copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/rng     creating build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl     copying src/lxml/isoschematron/resources/xsl/rng2schtrn.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl     copying src/lxml/isoschematron/resources/xsl/xsd2schtrn.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl     creating build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.10-intel-2.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1     running build_ext     building 'lxml.etree' extension     creating build/temp.macosx-10.10-intel-2.7     creating build/temp.macosx-10.10-intel-2.7/src     creating build/temp.macosx-10.10-intel-2.7/src/lxml     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/usr/include/libxml2 -i/private/tmp/pip-build-bdtxat/lxml/src/lxml/includes -i/system/library/frameworks/python.framework/versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.10-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace     in file included src/lxml/lxml.etree.c:239:     /private/tmp/pip-build-bdtxat/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found     #include "libxml/xmlversion.h"              ^     1 error generated.     error: command 'cc' failed exit status 1      ---------------------------------------- command "/usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-bdtxat/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gmvcn9-record/install-record.txt --single-version-externally-managed --compile" failed error code 1 in /private/tmp/pip-build-bdtxat/lxml 

if read through log might spot line:

c/_cffi_backend.c:13:10: fatal error: 'ffi.h' file not found 

the "fatal error" part important. :)

this means ffi headers couldn't located compiler. i'm not sure how since i'm not mac user maybe homebrew you, or google. me seems should install homebrew , run:

brew install libffi 

then try pip again.

edit

the full list of dependencies are:

  • python
  • libffi
  • libssl
  • libxml2
  • libxslt1

so you'll need those, , headers, if want continue down path.

an easier solution download pre-built binaries mac, mitmproxy.org (osx mountain lion , later). found info in installation docs.


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -