Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

  1. #1

    Question Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Hello, all.

    I just installed a fresh openSUSE Leap 15.2. After the update, the Python 3 version is 3.6.12. I need version 3.8.x without affecting the system-installed Python version, so I'm planning to do this via virtualenv.

    What is the best way to do this?

    I planned on downloading Python 3.8 from THIS LINK under "Grab binary packages directly". What I don't know is if installing this .rpm with YaST will overwrite the baseline Python 3 installation.

    If I can install this package into a dedicated place in my home directory (without messing up the baseline Python), I can proceed with the virtualenv setup.

    Thanks in advance for your help!

  2. #2
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    472

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    The best way to do this is to use the Opensuse packages.

    What does "sudo zypper search virtualenv" for you?

    If it does not list virtuelenv, try adding the Python-devel repo:

    Code:
    zypper addrepo https://download.opensuse.org/repositories/devel:languages:python/openSUSE_Leap_15.2/devel:languages:python.repo
    zypper refresh
    and try again.

  3. #3
    Join Date
    Jun 2008
    Location
    West Yorkshire, UK
    Posts
    3,576

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    There is an example of how to do this in http://bradlug.co.uk/blog/2020/07/16...asmotizer-indi where the text on the webpage was generated on a computer running Leap 15.2.

  4. #4

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    I appreciate your feedback, guys. I'll check after work and let you know. Thanks!

  5. #5

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Hello again. So here's my update.
    [1] The link you referenced was for for using venv (which I initially considered). The problem is that the virtual environments that venv creates are of the same version as the system installation of Python. Since I have 3.6.12 and want 3.8.x, that won't work - hence my choice to use virtualenv.
    [2] Regarding virtualenv, yes I have the option to install it from one of the default repositories. That in itself is not an issue for me, it's the fact that virtualenv expects the desired Python version (3.8.x in my case) to be already installed somewhere in the computer. It then points to it when creating the virtual environments.

    My problem is how to install Python 3.8 "somewhere" without messing up the default Python installation. I thought that by downloading the .rpm myself I could somehow install it in some directory of mine and proceeding. I just don't know how (or if you can even do that with a .rpm package).

    Any other thoughts? Thanks!

  6. #6
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    472

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Quote Originally Posted by r0b0ty View Post
    it's the fact that virtualenv expects the desired Python version (3.8.x in my case) to be already installed somewhere in the computer. It then points to it when creating the virtual environments.
    Which python versions do you need?

    I see zypper offers python (that is 2.7), python3 (that is 3.8.9) and there is also python39, python38 and python36.
    You can install these version in parallel and the run virtuelenv.

  7. #7

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Awesome, Marel! I don't know why I didn't scroll down all the way. When I did a
    Code:
    sudo zypper search python3
    , I indeed got a whole bunch of results, but missed the python38 results (which were few in comparison).

    So I understand that if I install this package, it will exist in parallel... so I'll try just that. Thanks a lot!

  8. #8

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Well, that didn't go too well for me. It seems like it's trying to overwrite the existing 3.6.12 Python installation, which is what I do NOT want. Any ideas?

    Code:
    r0b0ty@localhost:~> sudo zypper install python38 
    Loading repository data... 
    Reading installed packages... 
    Resolving package dependencies... 
     
    Problem: python38-3.8.10-lp152.49.1.x86_64 requires python(abi) = 3.8, but this requirement cannot be provided 
      not installable providers: python38-base-3.8.10-lp152.49.1.x86_64[https-download.opensuse.org-18a47cbb] 
     Solution 1: Following actions will be done: 
      install python38-base-3.8.10-lp152.49.1.x86_64 (with vendor change) 
        openSUSE  -->  obs://build.opensuse.org/devel:languages:python 
      deinstallation of python3-dbm-3.6.12-lp152.4.17.1.x86_64 
      deinstallation of python3-curses-3.6.12-lp152.4.17.1.x86_64 
     Solution 2: do not install python38-3.8.10-lp152.49.1.x86_64 
     Solution 3: break python38-3.8.10-lp152.49.1.x86_64 by ignoring some of its dependencies

  9. #9
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    472

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    Okay, that is not working out of the box, you are running in a problem with incompatible modules.

    Only alternative then seems to install other Python versions from source.
    Looks to me like also a good reason to try running a Virtual machine and have that run a different Python version but I do not have experience with that.

  10. #10
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,138

    Default Re: Install Python 3.8 Using virtualenv in OpenSUSE Leap 15.2

    You can always use Anaconda to install any python version on your system.

    Have a looksee here; https://www.anaconda.com/products/individual#linux , https://docs.anaconda.com/ and https://docs.anaconda.com/anaconda/install/linux/

    Do not be alarmed, it's not commercial or closed source - they simply have an enterprise offering as well. We use it at my old job to manage multiple different python versions on SUSE boxes when we need it.
    .: miuku #suse @ irc.freenode.net

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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