ImportError: No module named 'httplib' in Python 3

Issue #226 on hold
BEN ZID ELGUEBSI Wael
created an issue

Description of problem:

When I run tox for python 3 env I got an error, below a copy of the traceback:

Environment:

  • Python 3.3 & 3.4
  • tox: v1.9
  • pip: v6.0.8

Traceback (most recent call last):

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 9, in <module>

from http.client import HTTPConnection as _HTTPConnection, HTTPException

ImportError: No module named 'http.client'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File ".tox/py33/bin/pip", line 7, in <module>

from pip import main

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/init.py", line 15, in <module>

from pip.vcs import git, mercurial, subversion, bazaar  # noqa

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/vcs/mercurial.py", line 11, in <module>

from pip.download import path_to_url

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/download.py", line 30, in <module>

from pip._vendor import requests, six

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/init.py", line 58, in <module>

from . import utils

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/utils.py", line 26, in <module>

from .compat import parse_http_list as _parse_list_header

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/compat.py", line 7, in <module>

from .packages import chardet

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/packages/init.py", line 3, in <module>

from . import urllib3

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/packages/urllib3/init.py", line 10, in <module>

from .connectionpool import (

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 31, in <module>

from .connection import (

File "/home/wael/workspace/octopus/.tox/py33/lib/python3.3/site-packages/pip/_vendor/requests/packages/urllib3/connection.py", line 11, in <module>

from httplib import HTTPConnection as _HTTPConnection, HTTPException

ImportError: No module named 'httplib'

___________ summary ___________

ERROR: py33: InvocationError: /home/wael/workspace/octopus/.tox/py33/bin/pip install --pre -U --no-deps /home/wael/workspace/octopus/.tox/dist/octopus-0.0.1.zip (see /home/wael/workspace/octopus/.tox/py33/log/py33-6.log)

Comments (7)

  1. BEN ZID ELGUEBSI Wael reporter

    Below a snapshot of my tox.ini:

    [tox]
    envlist = py27, py33, py34
    
    [testenv]
    setenv =
        PYTHONPATH = {toxinidir}:{toxinidir}/octopus
    commands = python setup.py test
    deps =
        -r{toxinidir}/requirements/test.txt
    

    When I remove the setenv setting, it works. What's wrong in this line ?

  2. Log in to comment