Results 1 to 3 of 3

Thread: Python3.6 Upgrade - problems with PIP, _socket, urllib3

  1. #1
    Join Date
    Nov 2016

    Exclamation Python3.6 Upgrade - problems with PIP, _socket, urllib3

    Hey guys,

    I built Python3.6 from source in Leap 42.2 with make altinstall next to version 3.4. I adjusted PYTHONHOME and PYTHONPATH as follows:

    /usr/lib/python3.6:/usr/lib64/python3.6 /usr/lib/python3.6:/usr/lib/python3.6/site-packages:/usr/lib64/python3.6/lib-dynload
    I was able to install several site-packages like pandas via:

    ~ sudo python3.6 -m pip install pandas 
    pip3.6 itself shows off errors.

    ~ sudo pip3.6 install pandas
    Could not find platform dependent libraries <exec_prefix>
    Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
    Traceback (most recent call last):
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/", line 27, in <module>
        from . import urllib3
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/", line 8, in <module>
        from .connectionpool import (
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/", line 7, in <module>
        from socket import error as SocketError, timeout as SocketTimeout
      File "/usr/lib/python3.6/", line 49, in <module>
        import _socket
    ModuleNotFoundError: No module named '_socket'
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/usr/bin/pip3.6", line 7, in <module>
        from pip import main
      File "/usr/lib/python3.6/site-packages/pip/", line 21, in <module>
        from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/", line 62, in <module>
        from .packages.urllib3.exceptions import DependencyWarning
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/", line 29, in <module>
        import urllib3
    ModuleNotFoundError: No module named 'urllib3'
    Do you have an idea what I can do? Especially I need to install keras, tensorflow, pyqt5 and all of them are usable neither with pip nor with pip3.6. If I start python3.6 via terminal and import _socket it works fine.

    Thanks in advance!

  2. #2
    Join Date
    Jun 2008
    Blog Entries

    Default Re: Python3.6 Upgrade - problems with PIP, _socket, urllib3

    So why not install the 3.6 build for Leap 42.2 from the Factory repo?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Jun 2008
    San Diego, Ca, USA
    Blog Entries

    Default Re: Python3.6 Upgrade - problems with PIP, _socket, urllib3

    I agree with Malcolm that you should install your Python from openSUSE when necessary.

    I'd also recommend
    - Install and use virtualenv to run versions of Python side by side on your system (You can then easily specify your chosen Python version for any directory tree). Last I checked, openSUSE Python systems are built with integrated virtualenv (pre-configured).
    - If you choose not to install Python from openSUSE, your next best option is to install Python from the Python repositories (using pip which you're already doing for individual apps). Building from source should be your last option when other options aren't available.

    That said,
    Your errors are describing dependencies which can't be found...
    They might be a result of missing or improper system paths, code which wasn't built or built properly or misconfiguration. Hard to tell exact cause without investigation but all of this can be avoided by installing pre-compiled Python.

    Beginner Wiki Quickstart -
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts