mitmproxy installation error - proxy

I trying to install mitmproxy on centos 6.4 with python 2.6.6, I am getting below error when execute install command.
#pip install mitmproxy
Downloading/unpacking mitmproxy
Running setup.py egg_info for package mitmproxy
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/mitmproxy/setup.py", line 19
"netlib>=%s, <%s" % (version.MINORVERSION, version.NEXT_MINORVERSION),
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/mitmproxy/setup.py", line 19
"netlib>=%s, <%s" % (version.MINORVERSION, version.NEXT_MINORVERSION),
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/mitmproxy
Storing complete log in /root/.pip/pip.log

That error seems to indicate that mitmproxy is not compatible with python 2.6.x. I assume that syntax is new for 2.7.x or something like that.
That line doesn't work for me in 2.4.3 or 2.6.6 but does in 2.7.8.

Related

Can't install pyenchant

I need installing pyenchant v1.6.7 on MacBook with Apple Silicon (M1 Pro) for Python 2.7.18.
This package is a wrapper for C-library enchant, so it requires to the enchant was installed firstly. Well, I've installed the enchant by: brew install enchant.
However, when I try to install pyenchant using PIP I got the next error:
cwd: /private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/8t/b2kn5tm162s614gvsfrdcbhm0000gn/T/pip-install-8FO32O/pyenchant/setup.py", line 210, in <module>
import enchant
File "enchant/__init__.py", line 92, in <module>
from enchant import _enchant as _e
File "enchant/_enchant.py", line 145, in <module>
raise ImportError(msg)
ImportError: The 'enchant' C library was not found. Please install it via your OS package manager, or use a pre-built binary wheel from PyPI.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Also I have tried to specify LDFLAGS and CFLAGS:
LDFLAGS='-L/opt/homebrew/Cellar/enchant/2.3.3/lib' CFLAGS="-I/opt/homebrew/Cellar/enchant/2.3.3/include" ~/.pyenv/versions/2.7.18/bin/pip install --no-cache-dir pyenchant==1.6.7
But it doesn't work, I still get the same error.
How to specify the enchant library for the pyenchant module?

How do I fix "Exception: Cannot find boost_python library"?

I got the following error message when trying to install osmium:
$ pip install osmium --user
[...]
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-hjt_5k/osmium/setup.py", line 115, in <module>
raise Exception("Cannot find boost_python library")
Exception: Cannot find boost_python library
How can I fix it?
The fix for that issue on Ubuntu 16.04 is
$ sudo apt-get install libboost-python-dev
Other issues
libosmium-2.14.2/include/osmium/io/bzip2_compression.hpp:52:19: fatal error: bzlib.h: No such file or directory
compilation terminated.
error: command 'c++' failed with exit status 1
is fixed with
sudo apt-get install libbz2-dev

Not being able to install LinkChecker

I'm having issues installing broken link-checker.
When I do 'sudo pip install LinkChecker' like said in installation, I get following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-uBq7xh/LinkChecker/setup.py", line 95, in <module>
import py2app
File "/Library/Python/2.7/site-packages/py2app/__init__.py", line 31, in <module>
__version__ = pkg_resources.require('py2app')[0].version
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 968, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 854, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'macholib>=1.4' distribution was not found and is required by py2app
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-uBq7xh/LinkChecker/
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The error message you get suggests you fail to meet the dependencies needed for the package you're installing.
Try installing macholib and upgrading pip, as suggested by the log
pip install macholib
pip install --upgrade pip

TensorFlow installation on Ubuntu

When I try to install TensorFlow Machine Learning library on Ubunto (vmware image) using command :
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
after downloading the package I got this error :
Traceback (most recent call last):
File "", line 14, in
IOError: [Errno 2] No such file or directory: '/tmp/pip-GgS7fR-build/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 14, in
IOError: [Errno 2] No such file or directory:
'/tmp/pip-GgS7fR-build/setup.py'
I am using pip, python 2.7 and Ubuntu 12.04 LTS vmware image
Can anyone please help me to solve this error?
full pip.log file error :
------------------------------------------------------------
/usr/bin/pip run on Sun Nov 22 06:06:30 2015
Downloading/unpacking https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Downloading from URL https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Running setup.py egg_info for package from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-GgS7fR-build/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-GgS7fR-build/setup.py'
----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 980, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 216, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
Try installing Ubuntu 14.04 in VMware and use the same command.

PyGreSQL on Heroku

Is PyGreSQL unsupported on Heroku, or am I doing something wrong in my requirements.txt file?
web.py==0.36
PyGreSQL
When I run pip locally, everything installs fine. When I try to deploy, I get the following error message.
-----> Installing dependencies using pip version 1.0.2
Requirement already satisfied (use --upgrade to upgrade): web.py==0.36 in ./.heroku/venv/lib/python2.7/site-packages (from -r requirements.txt (line 1))
Downloading/unpacking PyGreSQL (from -r requirements.txt (line 2))
Storing download in cache at /app/tmp/repo.git/.cache/pip_downloads/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FP%2FPyGreSQL%2FPyGreSQL-4.0.tar.gz
Running setup.py egg_info for package PyGreSQL
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/tmp/build_35fg1nd48mese/.heroku/venv/build/PyGreSQL/setup.py", line 98, in <module>
mk_include()
File "/tmp/build_35fg1nd48mese/.heroku/venv/build/PyGreSQL/setup.py", line 69, in mk_include
for f in os.listdir(pg_include_dir_server):
OSError: [Errno 2] No such file or directory: '/usr/include/postgresql/8.4/server'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/tmp/build_35fg1nd48mese/.heroku/venv/build/PyGreSQL/setup.py", line 98, in <module>
mk_include()
File "/tmp/build_35fg1nd48mese/.heroku/venv/build/PyGreSQL/setup.py", line 69, in mk_include
for f in os.listdir(pg_include_dir_server):
OSError: [Errno 2] No such file or directory: '/usr/include/postgresql/8.4/server'
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /app/.pip/pip.log
! Heroku push rejected, failed to compile Python app
The PyGreSQL library does not support PostgreSQL 9.1 at the moment, and therefore is incompatible with Heroku.

Resources