tox-dev / tox

Command line driven CI frontend and development task automation tool.
https://tox.wiki
MIT License
3.69k stars 523 forks source link

[BUG] Tox command failed with ImportError: No module named 'zlib' #1254

Closed viraj1899 closed 5 years ago

viraj1899 commented 5 years ago

Can i know what should be tox.ini configuration with respect to basepython version with respect to py27,py35,pep8 tox error.txt

Running tox -e py27 works fine with no error Running tox -e py35 works fine with no error

But running tox failed with below error

ERROR:   pep8: InvocationError for command /usr/bin/python2 -m virtualenv --python /usr/local/bin/python3.5 pep8 (exited with code 1)

System Details :

-->  [root@localhost kuryr]# which python
/usr/bin/python
---> [root@localhost kuryr]# python -V
Python 2.7.5
---> [root@localhost kuryr]# which pip
/usr/bin/pip
---> [root@localhost kuryr]# pip --version
pip 19.0.3 from /usr/lib/python2.7/site-packages/pip (python 2.7)
---> [root@localhost kuryr]# which tox
/usr/bin/tox
---> [root@localhost kuryr]# tox --version
3.8.6 imported from /usr/lib/python2.7/site-packages/tox/__init__.pyc
registered plugins:
    tox-travis-0.12 at /usr/lib/python2.7/site-packages/tox_travis/hooks.pyc
---> [root@localhost kuryr]# virtualenv --version
16.4.3
---> [root@localhost kuryr]# easy_install --version
setuptools 41.0.0 from /usr/lib/python2.7/site-packages (Python 2.7)

LOGS :

kuryr.tests.unit.binding.drivers.test_utils.BindingDriversUtilsTest.test__configure_container_iface_3____10_10_10_11____10_11_0_10______384ac9fc_eefa_4399_8d88_1181433e33b1____0a6eab28_9dc1_46c0_997c_cb9f66f6081f____False__1500___fa_16_3e_22_a3_3d__  0.002
pep8 recreate: /kuryr/.tox/pep8
ERROR: invocation failed (exit code 1), logfile: /kuryr/.tox/pep8/log/pep8-0.log
============================================================================== log start ===============================================================================
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/virtualenv.py", line 37, in <module>
    import zlib
ImportError: No module named 'zlib'
Running virtualenv with interpreter /usr/local/bin/python3.5

=============================================================================== log end ================================================================================
ERROR: InvocationError for command /usr/bin/python2 -m virtualenv --python /usr/local/bin/python3.5 pep8 (exited with code 1)
_______________________________________________________________________________ summary ________________________________________________________________________________
  python3.5: commands succeeded
  py27: commands succeeded
ERROR:   pep8: InvocationError for command /usr/bin/python2 -m virtualenv --python /usr/local/bin/python3.5 pep8 (exited with code 1)
viraj1899 commented 5 years ago

@gaborbernat please find package installed [root@localhost tests]# pip list DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Package Version


alembic 1.0.8 amqp 2.4.2 appdirs 1.4.3 asn1crypto 0.24.0 Babel 2.6.0 backports.functools-lru-cache 1.5 backports.ssl-match-hostname 3.5.0.1 beautifulsoup4 4.7.1 cachetools 3.1.0 certifi 2019.3.9 cffi 1.12.2 chardet 3.0.4 cliff 2.14.1 cmd2 0.8.9 configobj 4.7.2 configparser 3.7.4 contextlib2 0.5.5 cryptography 2.6.1 debtcollector 1.21.0 decorator 3.4.0 dnspython 1.16.0 dogpile.cache 0.7.1 entrypoints 0.3 enum34 1.1.6 eventlet 0.24.1 extras 1.0.0 fasteners 0.14.1 filelock 3.0.10 fixtures 3.0.0 flake8 3.7.7 funcsigs 1.0.2 functools32 3.2.3.post2 futures 3.2.0 futurist 1.8.1 greenlet 0.4.15 idna 2.8 iniparse 0.4 ipaddress 1.0.16 iso8601 0.1.12 Jinja2 2.10.1 jmespath 0.9.4 jsonpatch 1.23 jsonpointer 2.0 keystoneauth1 3.13.1 kombu 4.5.0 kuryr-lib 0.10.0.dev2 linecache2 1.0.0 logutils 0.3.5 Mako 1.0.8 MarkupSafe 1.1.1 mccabe 0.6.1 mock 2.0.0 monotonic 1.5 msgpack 0.6.1 munch 2.3.2 netaddr 0.7.19 netifaces 0.10.9 neutron-lib 1.25.0 openstacksdk 0.27.0 os-client-config 1.32.0 os-service-types 1.6.0 os-traits 0.11.0 osc-lib 1.12.1 oslo.concurrency 3.29.1 oslo.config 6.8.1 oslo.context 2.22.1 oslo.db 4.45.0 oslo.i18n 3.23.1 oslo.log 3.42.3 oslo.messaging 9.5.0 oslo.middleware 3.37.1 oslo.policy 2.1.1 oslo.serialization 2.28.2 oslo.service 1.38.0 oslo.upgradecheck 0.2.1 oslo.utils 3.40.3 oslo.versionedobjects 1.35.1 osprofiler 2.6.0 Paste 3.0.8 PasteDeploy 2.0.1 pbr 5.1.3 pecan 1.3.3 perf 0.1 pip 19.0.3 pluggy 0.9.0 prettytable 0.7.2 py 1.8.0 pycodestyle 2.5.0 pycparser 2.19 pycurl 7.19.0 pyflakes 2.1.1 pygobject 3.22.0 pygpgme 0.3 pyinotify 0.9.6 pyliblzma 0.5.3 pyparsing 2.4.0 pyperclip 1.7.0 pyroute2 0.5.5 python-dateutil 2.8.0 python-editor 1.0.4 python-keystoneclient 3.19.0 python-linux-procfs 0.4.9 python-mimeparse 1.6.0 python-neutronclient 6.12.0 pytz 2018.9 pyudev 0.15 pyxattr 0.5.1 PyYAML 5.1 repoze.lru 0.7 requests 2.21.0 requestsexceptions 1.4.0 rfc3986 1.2.0 Routes 2.4.1 schedutils 0.4 setproctitle 1.1.10 setuptools 41.0.0 simplejson 3.16.0 singledispatch 3.4.0.3 six 1.12.0 slip 0.4.0 slip.dbus 0.4.0 soupsieve 1.9 SQLAlchemy 1.3.2 sqlalchemy-migrate 0.12.0 sqlparse 0.3.0 statsd 3.3.0 stevedore 1.30.1 subprocess32 3.5.3 Tempita 0.5.2 testresources 2.0.1 testscenarios 0.5.0 testtools 2.3.0 toml 0.10.0 tox 3.8.6 tox-travis 0.12 traceback2 1.4.0 typing 3.6.6 unicodecsv 0.14.1 unittest2 1.1.0 urlgrabber 3.10 urllib3 1.24.1 vine 1.3.0 virtualenv 16.4.3 waitress 1.2.1 wcwidth 0.1.7 weakrefmethod 1.0.3 WebOb 1.8.5 WebTest 2.0.33 wrapt 1.11.1 yappi 1.0 yum-metadata-parser 1.1.4

gaborbernat commented 5 years ago

Can you replicate this inside a Docker image? Seems again a virtualenv issue, but would need to investigate more to find the root cause.

viraj1899 commented 5 years ago

@gaborbernat OK but as i am new to Docker, can you please let me know how can i replicate this in Docker Image ? Will like to dig more into it

viraj1899 commented 5 years ago

@gaborbernat You may close the issue,as the issue if fixed. I have recreated the environment to run using python3.5 using tox -r py35 and set python=python3.5