unixsurfer / haproxyadmin

A python library to interact with HAProxy over UNIX socket
Apache License 2.0
113 stars 31 forks source link

Installation Error #7

Closed lconnell closed 7 years ago

lconnell commented 7 years ago

[root@host haproxyadmin]# python2.7 setup.py install ERROR:root:Error parsing Traceback (most recent call last): File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/core.py", line 111, in pbr attrs = util.cfg_to_args(path, dist.script_args) File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/util.py", line 264, in cfg_to_args wrap_commands(kwargs) File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/util.py", line 566, in wrap_commands cmdclass = ep.resolve() File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pkg_resources/init.py", line 2297, in resolve module = import(self.module_name, fromlist=['name'], level=0) ImportError: No module named scripts.setupcommands error in setup command: Error parsing /root/haproxyadmin/setup.cfg: ImportError: No module named scripts.setupcommands [root@cblb-e1a-01 haproxyadmin]# pip2.7 list DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. appdynamics (4.2.3.0) appdynamics-bindeps-linux-x64 (4.2.3.0) appdynamics-proxysupport-linux-x64 (1.8.0.51) awscli (1.10.52) botocore (1.4.42) colorama (0.3.7) docutils (0.12) futures (3.0.5) jmespath (0.9.0) meld3 (1.0.2) pbr (1.10.0) pip (9.0.1) psutil (5.0.0) pyasn1 (0.1.9) python-dateutil (2.5.3) rsa (3.4.2) s3transfer (0.1.1) setuptools (29.0.1) six (1.10.0) supervisor (3.1.3) uWSGI (2.0.12) wheel (0.29.0)

unixsurfer commented 7 years ago

I am experiencing similar issue in python2 environment ImportError: No module named testrepository error in setup command: Error parsing /home/pparissis/repo/github/haproxyadmin/setup.cfg: ImportError: No module named testrepository I don't have issues in python34 and python35 environments. Something has been changed in setuptools and pbr, I am checking what caused this.

unixsurfer commented 7 years ago

Installation works via pip for python27: pip install haproxyadmin Collecting haproxyadmin Downloading haproxyadmin-0.2.1.tar.gz (55kB) 100% |████████████████████████████████| 61kB 1.5MB/s Requirement already satisfied: six in /home/pparissis/.virtualenvs/python2/lib/python2.7/site-packages (from haproxyadmin) Installing collected packages: haproxyadmin Running setup.py install for haproxyadmin ... done Successfully installed haproxyadmin-0.2.1

Can you try to installed it via pip?

unixsurfer commented 7 years ago

In my case the issue resolved by install with pip testrepository module.

unixsurfer commented 7 years ago

It is quite difficult to troubleshoot the error you got because I can't reproduce your specific error. I hope you can install it using pip.

lconnell commented 7 years ago

I have tried with pip. I'll try to install with the module you mentioned. Thanks.

unixsurfer commented 7 years ago

Was it successfully installed using pip ?

lconnell commented 7 years ago

It is still failing even after install testrepository.

pip2.7 install testrepository Collecting testrepository Downloading testrepository-0.0.20.tar.gz (84kB) 100% |████████████████████████████████| 92kB 6.3MB/s Collecting fixtures (from testrepository) Downloading fixtures-3.0.0-py2.py3-none-any.whl (67kB) 100% |████████████████████████████████| 71kB 6.7MB/s Collecting python-subunit>=0.0.18 (from testrepository) Downloading python_subunit-1.2.0-py2.py3-none-any.whl (112kB) 100% |████████████████████████████████| 122kB 7.7MB/s Collecting testtools>=0.9.30 (from testrepository) Downloading testtools-2.2.0-py2.py3-none-any.whl (195kB) 100% |████████████████████████████████| 204kB 5.4MB/s Requirement already satisfied: six in /app/interpreters/python/2.7.11/lib/python2.7/site-packages (from fixtures->testrepository) Requirement already satisfied: pbr>=0.11 in /app/interpreters/python/2.7.11/lib/python2.7/site-packages (from fixtures->testrepository) Collecting extras (from python-subunit>=0.0.18->testrepository) Downloading extras-1.0.0-py2.py3-none-any.whl Collecting python-mimeparse (from testtools>=0.9.30->testrepository) Downloading python_mimeparse-1.6.0-py2.py3-none-any.whl Collecting unittest2>=1.0.0 (from testtools>=0.9.30->testrepository) Downloading unittest2-1.1.0-py2.py3-none-any.whl (96kB) 100% |████████████████████████████████| 102kB 7.2MB/s Collecting traceback2 (from testtools>=0.9.30->testrepository) Downloading traceback2-1.4.0-py2.py3-none-any.whl Collecting argparse (from unittest2>=1.0.0->testtools>=0.9.30->testrepository) Downloading argparse-1.4.0-py2.py3-none-any.whl Collecting linecache2 (from traceback2->testtools>=0.9.30->testrepository) Downloading linecache2-1.0.0-py2.py3-none-any.whl Building wheels for collected packages: testrepository Running setup.py bdist_wheel for testrepository ... done Stored in directory: /root/.cache/pip/wheels/24/69/16/7ebd1d6ca5343cb465b59e40cf15c1a3d24db4d0e925c96078 Successfully built testrepository Installing collected packages: python-mimeparse, extras, argparse, linecache2, traceback2, unittest2, testtools, fixtures, python-subunit, testrepository Successfully installed argparse-1.4.0 extras-1.0.0 fixtures-3.0.0 linecache2-1.0.0 python-mimeparse-1.6.0 python-subunit-1.2.0 testrepository-0.0.20 testtools-2.2.0 traceback2-1.4.0 unittest2-1.1.0`

pip2.7 install haproxyadmin Collecting haproxyadmin Using cached haproxyadmin-0.2.1.tar.gz Complete output from command python setup.py egg_info: ERROR:root:Error parsing Traceback (most recent call last): File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/core.py", line 111, in pbr attrs = util.cfg_to_args(path, dist.script_args) File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/util.py", line 264, in cfg_to_args wrap_commands(kwargs) File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pbr/util.py", line 566, in wrap_commands cmdclass = ep.resolve() File "/app/interpreters/python/2.7.11/lib/python2.7/site-packages/pkg_resources/init.py", line 2297, in resolve module = import(self.module_name, fromlist=['name'], level=0) ImportError: No module named scripts.setupcommands error in setup command: Error parsing /tmp/pip-build-137tQn/haproxyadmin/setup.cfg: ImportError: No module named scripts.setupcommands

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-137tQn/haproxyadmin/`

pip2.7 list

appdynamics (4.2.3.0) appdynamics-bindeps-linux-x64 (4.2.3.0) appdynamics-proxysupport-linux-x64 (1.8.0.51) awscli (1.10.52) botocore (1.4.42) colorama (0.3.7) docutils (0.12) extras (1.0.0) fixtures (3.0.0) futures (3.0.5) haproxy-stats (1.3) haproxy-top (0.2) jmespath (0.9.0) linecache2 (1.0.0) meld3 (1.0.2) pbr (1.10.0) pip (9.0.1) psutil (5.0.0) pyasn1 (0.1.9) python-dateutil (2.5.3) python-mimeparse (1.6.0) python-subunit (1.2.0) requests (2.12.3) rsa (3.4.2) s3transfer (0.1.1) setuptools (29.0.1) six (1.10.0) supervisor (3.1.3) testrepository (0.0.20) testtools (2.2.0) traceback2 (1.4.0) unittest2 (1.1.0) uWSGI (2.0.12) wheel (0.29.0)`

python2.7 -V Python 2.7.11

unixsurfer commented 7 years ago

It works on me, I don't really understand why it fails

(python2)pparissis at foo in ~
pip install haproxyadmin
Collecting haproxyadmin
  Using cached haproxyadmin-0.2.1.tar.gz
Requirement already satisfied: six in ./.virtualenvs/python2/lib/python2.7/site-packages (from haproxyadmin)
Installing collected packages: haproxyadmin
  Running setup.py install for haproxyadmin ... done
Successfully installed haproxyadmin-0.2.1
pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
docopt (0.6.2)
extras (1.0.0)
fixtures (3.0.0)
haproxyadmin (0.2.1)
linecache2 (1.0.0)
pbr (1.10.0)
pip (9.0.1)
python-mimeparse (1.6.0)
python-subunit (1.2.0)
setuptools (29.0.1)
six (1.10.0)
testrepository (0.0.20)
testtools (2.2.0)
traceback2 (1.4.0)
unittest2 (1.1.0)
lconnell commented 7 years ago

It works for py2.6 but not py2.7. they were both packaged differently. it looks like a path issue or something.

Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import sys print(sys.path) ['', '/usr/lib/python2.6/site-packages/pip-9.0.1-py2.6.egg', '/usr/lib64/python26.zip', '/usr/lib64/python2.6', '/usr/lib64/python2.6/plat-linux2', '/usr/lib64/python2.6/lib-tk', '/usr/lib64/python2.6/lib-old', '/usr/lib64/python2.6/lib-dynload', '/usr/lib64/python2.6/site-packages', '/usr/lib/python2.6/site-packages', '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info']

[root@cblb-e1a-01 ~]# python2.7 Python 2.7.11 (default, May 19 2016, 17:54:01) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import sys print(sys.path) ['', '/app/interpreters/python/2.7.11/lib/python27.zip', '/app/interpreters/python/2.7.11/lib/python2.7', '/app/interpreters/python/2.7.11/lib/python2.7/plat-linux2', '/app/interpreters/python/2.7.11/lib/python2.7/lib-tk', '/app/interpreters/python/2.7.11/lib/python2.7/lib-old', '/app/interpreters/python/2.7.11/lib/python2.7/lib-dynload', '/app/interpreters/python/2.7.11/lib/python2.7/site-packages']

lconnell commented 7 years ago

Very odd, I had to uninstall appdynamics and then I was able to install haproxyadmin.

unixsurfer commented 7 years ago

Very weird, at least you managed to solve it