Skip to content

AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3' #9788

Open

Description

@applar

sudo python setup.py install
ipython
There is a error as flows.

jiangyuping@Lenovo:~/ipython$ ipython
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 4, in
from IPython import start_ipython
File "/home/jiangyuping/ipython/IPython/init.py", line 48, in
from .core.application import Application
File "/home/jiangyuping/ipython/IPython/core/application.py", line 23, in
from traitlets.config.application import Application, catch_config_error
ImportError: No module named traitlets.config.application

Then, pip install ipython
to solve this problem
And, it appears the other error as flows.

jiangyuping@Lenovo:~/ipython$ pip install -e
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in
load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2355, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2361, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/init.py", line 11, in
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/vcs/mercurial.py", line 9, in
from pip.download import path_to_url
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/download.py", line 22, in
from pip._vendor import requests, six
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/init.py", line 53, in
from .packages.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 70, in
ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

Activity

  1. takluyver commented on Jul 21, 2016

    @takluyver
    Member

    That's not an IPython issue, but you've got your Python into a mess somehow. I'd start by deleting the copy of pip you've got installed as an egg:

    rm -r /usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg
    rm -r /usr/local/bin/pip
    

    Then, guessing that you're on Debian/Ubuntu or something similar, start with pip provided by the distribution, and use that to install a newer version:

    sudo apt-get install python-pip
    pip install --upgrade --user setuptools pip
    

    And then try installing IPython again:

    pip install ipython
    
  2. added this to the not ipython milestone on Jul 21, 2016
  3. applar commented on Jul 21, 2016

    @applar
    Author

    @takluyver I do it with your suggestion, but, it doesn't work.

  4. takluyver commented on Jul 21, 2016

    @takluyver
    Member

    it doesn't work.

    Which bit didn't work? I'm not psychic ;-)

  5. applar commented on Jul 21, 2016

    @applar
    Author

    @takluyver The last one code doesn't work. When running it, it appears that error. However, thank you very much.

  6. takluyver commented on Jul 21, 2016

    @takluyver
    Member

    Can you paste the error you get? If the earlier commands worked, it can't be exactly the same, because you deleted the file that the error was coming from before.

  7. applar commented on Jul 22, 2016

    @applar
    Author

    @takluyver

    jiangyuping@Lenovo:/$ pip install --upgrade --user setuptools pip

    Traceback (most recent call last):
    File "/usr/local/bin/pip", line 9, in
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
    File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
    File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2682, in load_entry_point
    return ep.load()
    File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2355, in load
    return self.resolve()
    File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2361, in resolve
    module = import(self.module_name, fromlist=['name'], level=0)
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/init.py", line 11, in
    from pip.vcs import git, mercurial, subversion, bazaar # noqa
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/vcs/mercurial.py", line 9, in
    from pip.download import path_to_url
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/download.py", line 22, in
    from pip._vendor import requests, six
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/init.py", line 53, in
    from .packages.urllib3.contrib import pyopenssl
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py", line 70, in
    ssl.PROTOCOL_SSLv3: OpenSSL.SSL.SSLv3_METHOD,
    AttributeError: 'module' object has no attribute 'PROTOCOL_SSLv3'

  8. takluyver commented on Jul 23, 2016

    @takluyver
    Member

    It appears that this command had no effect:

    rm -r /usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg
    
  9. hzcyf commented on Aug 5, 2017

    @hzcyf

    thanks you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions