Results 1 to 3 of 3

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

  1. #1
    Join Date
    Nov 2016
    Location
    Dresden
    Posts
    12

    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:

    Code:
    ~ echo $PYTHONHOME $PYTHONPATH
    /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:

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

    Code:
    ~ 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/__init__.py", line 27, in <module>
        from . import urllib3
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py", line 8, in <module>
        from .connectionpool import (
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 7, in <module>
        from socket import error as SocketError, timeout as SocketTimeout
      File "/usr/lib/python3.6/socket.py", 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/__init__.py", line 21, in <module>
        from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py", line 62, in <module>
        from .packages.urllib3.exceptions import DependencyWarning
      File "/usr/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", 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!
    Reiti

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,665
    Blog Entries
    15

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

    Hi
    So why not install the 3.6 build for Leap 42.2 from the Factory repo?
    https://build.opensuse.org/project/s...python:Factory

    http://download.opensuse.org/reposit...USE_Leap_42.2/
    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
    Location
    San Diego, Ca, USA
    Posts
    11,128
    Blog Entries
    2

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

    First,
    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.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    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
  •