سؤال

Im trying to install mitmproxy on a Ubuntu 14.04 computer, but I'm getting error. I found on the web how I should install it by using this code:

sudo install pip mitmproxy

So I installed python, now when I run the command it works until I get this problem:

Command python.py egg_info failed with error code 1 in /tmp/pip_build_root/cryptography

I tried to update python but still the same Exactly I installed python in this way:

sudo apt-get install python-pyasn1 python-flask python-urwid 

What's wrong???

UPDATE

Here is the pip.log

هل كانت مفيدة؟

المحلول 2

Judging by the log you got from pip the problem here is that the development libraries for libffi are not installed. You can rectify it with:

$ sudo apt-get install libffi-dev

and retry installing.

The clue in your error log is this line:

Package libffi was not found in the pkg-config search path.

If pkg-config is unable to find a library it means that the files needed to develop with this library are missing. On an Ubuntu or Debian system this usually means installing the package that has the name of the library plus -dev.

نصائح أخرى

You can also pip install from github:

In this order:

  1. Install netlib: (sudo) pip install git+https://github.com/mitmproxy/netlib.git
  2. Install mitmproxy: (sudo) pip install git+https://github.com/mitmproxy/mitmproxy.git

This will install all requisite libraries and provide you with the most up-to-date version of mitmproxy.

Running these 2 commands worked for me (Ubuntu 14.04)

sudo apt-get install python-pip python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev

sudo pip install mitmproxy

EDIT: You need to run this command before you will be able to use "mitmproxy -p port_number". since it gives error "Error: mitmproxy requires a UTF console environment."

export LC_ALL=en_US.UTF-8

EDIT 2: After installation, you need to generate certificate first and have to transfer it into your device then setup manual proxy by entering your computer's IP address and port on which you will run mitmproxy server. Use below commands to generate certificate:

sudo apt-get install libnss3-tools
certutil -d sql:$HOME/.pki/nssdb -A -t C -n mitmproxy -i ~/.mitmproxy/mitmproxy-ca-cert.pem
$ pip uninstall mitmproxy netlib

$ sudo apt-get install -y build-essential libssl-dev libffi-dev python-dev python-pip libxml2-dev libxslt-dev git

$ sudo pip install git+https://github.com/mitmproxy/netlib.git@master

 sudo pip install git+https://github.com/mitmproxy/mitmproxy.git@master

$ sudo python  # 
>>> from netlib import certffi
>>> exit()
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top