1
votes

When I try to install mitmproxy by the easy_install on windows 7, I got error with ascii.

Here is the console result from cmd.

C:\Python27\Scripts>easy_install D:_python\mitmproxy-0.9.2

Processing mitmproxy-0.9.2

Writing D:_python\mitmproxy-0.9.2\setup.cfg

Running setup.py -q bdist_egg --dist-dir D:_python\mitmproxy-0.9.2\egg-dist-tmp -qdtwhc

zip_safe flag not set; analyzing archive contents...

libmproxy.utils: module references file

libmproxy.contrib.pyparsing: module MAY be using inspect.stack

libmproxy.contrib.jsbeautifier.unpackers.init: module references path mitmproxy 0.9.2 is already the active version in easy-install.pth

Installing mitmdump script to C:\Python27\Scripts

Installing mitmproxy script to C:\Python27\Scripts

Installed c:\python27\lib\site-packages\mitmproxy-0.9.2-py2.7.egg

Processing dependencies for mitmproxy==0.9.2

Searching for pyopenssl>=0.13

Reading https://pypi.python.org/simple/pyopenssl/

Best match: pyOpenSSL 0.13.1

Downloading https://pypi.python.org/packages/2.7/p/pyOpenSSL/pyOpenSSL-0.13.1.win32-py2.7.exe#md5=02b016ed32fffcff56568e5834edcae6

Processing pyOpenSSL-0.13.1.win32-py2.7.exe

Traceback (most recent call last):
File "C:\Python27\Scripts\easy_install-script.py", line 9, in module load_entry_point('setuptools==1.1.6', 'console_scripts', 'easy_install')()

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1925, in main

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1912, in with_ei_usage

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1929, in lambda

File "C:\Python27\lib\distutils\core.py", line 152, in setup dist.run_commands()

File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd)

File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run()

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 374, in run

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 590, in easy_install

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 641, in install_item

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 687, in process_distribution

File "build\bdist.win32\egg\pkg_resources.py", line 568, in resolve

File "build\bdist.win32\egg\pkg_resources.py", line 806, in best_match

File "build\bdist.win32\egg\pkg_resources.py", line 818, in obtain

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 609, in easy_install

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 639, in install_item

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 792, in install_eggs

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 869, in install_exe

File "build\bdist.win32\egg\setuptools\command\easy_install.py", line 1379, in extract_wininst_cfg

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 27: ordinal not in range(128)

Someone help me please!

Warm Regards, Rithy

1

1 Answers

1
votes

If using Python 2.x, you can comment this offending line:

# config = config.decode('ascii')

in easy_install.py (near line 1510):

# Now the config is in bytes, but on Python 3, it must be
#  unicode for the RawConfigParser, so decode it. Is this the
#  right encoding?
config = config.decode('ascii')
cfg.readfp(StringIO(config))