Visitar URL original
Python 2.7 support · Issue #2896 · streamlink/streamlink · GitHub
Skip to content

Python 2.7 support #2896

Closed
Closed

Description

@brouxco

Issue

  • This is not a bug report, feature request, or plugin issue/request.
  • I have read the contribution guidelines.

Description

Hi !
This is more of a question and the beginning of a discussion than an issue.

Python 2.7 is not maintained anymore (see: python/devguide#344)

It has been mentioned a few times in the project's issues that Python 2.7 is sometimes problematic.
Last time was only a few days ago (see: #2871 (comment))

I'm really new in this project and I understand that there are historical reasons for a Python 2.7 version of StreamLink but I would like to know if there is a plan on Python 2.7 support.

Maybe some users are still relying on Python 2.7, should they expect an end of support soon?
How many users would be impacted? Is there an easy way to know?

Activity

  1. gravyboat commented on Apr 15, 2020

    @gravyboat
    Member

    It really comes down to resources. If I could wave a magic wand I'd remove 2.7 support today. We're not going to support it, make code changes for it, or do any work to make Streamlink work with 2.7. The only plan around 2.7 is to stop supporting 2.7. If people are still relying on 2.7 they should expect it to go away at any time as 2.7 was already EoL, we just haven't gotten to it yet.

    There is no way to know how many users would be impacted, we don't track stats like that at all within the application but even if it impacted 95% of people I'd still push for removing it.

  2. brouxco commented on Apr 15, 2020

    @brouxco
    ContributorAuthor

    I understand.
    Should we stop testing Python 2.7 then?
    see: https://github.com/streamlink/streamlink/blob/master/.github/workflows/main.yml#L23

    we don't track stats like that at all within the application

    And I'm grateful for that.

  3. beardypig commented on Apr 15, 2020

    @beardypig
    Member

    I imagine 99% of the Windows installs are from the installer or a portable version, which use Python 3.5+.
    I would imagine a lot of the Linux installs are Python 2.7, because older distros use Python 2.7 by default, same goes for macOS I guess.

  4. gravyboat commented on Apr 16, 2020

    @gravyboat
    Member

    @brouxco When someone makes the PR to drop 2.7 support they'll stop testing 2.7, until then it needs to be tested. @beardypig I'm running it on 3.6+ on macOS since it's easy to run both with Brew. I don't think it's something worth worrying about as long as we announce it in the release notes.

  5. bastimeyer commented on Apr 16, 2020

    @bastimeyer
    Member

    Fedora and Ubuntu will be switching to python3 as default python interpreter in a couple of days. Apart from that, all available streamlink "system-packages" are based on python3.

    The only problem with dropping 2.7 are non-system-package installs via pip/setuptools which were done via the system's default python interpreter on distros shipping with python2 as the default one.

    These are the current default /usr/bin/python versions on various Linux distros and macOS:

    https://www.python.org/dev/peps/pep-0394/#history-of-this-pep

  6. malvinas2 commented on Apr 16, 2020

    @malvinas2
    Contributor

    Talking about Python: What are the minimal requirements for using version 3, so which version exactly?
    Hopefully it is quite a low version like 3.5 as updating Python on a Linux system, 'overwriting' the included version, is a pain in the ass and nearly never works.

  7. beardypig commented on Apr 16, 2020

    @beardypig
    Member

    We should remove support on July 2nd... :|

  8. bastimeyer commented on Apr 16, 2020

    @bastimeyer
    Member

    Should have also posted this site:
    https://python3statement.org/

    Also, as a small correction to my earlier post, many distros intentionally leave their python package (which provides /usr/bin/python) on version 2.7. The user is expected to run python3 explicitly via /usr/bin/python3. The python2 "drop" is then done by not having the python package installed by default, which is already the case on openSUSE for example. On Ubuntu, they are doing that with the upcoming release and are also providing the python-is-python3 package, which symlinks /usr/bin/python to /usr/bin/python3.


    @malvinas2
    https://github.com/streamlink/streamlink/blob/master/.github/workflows/main.yml#L23

    Here's the EOL list of the Python3 branches:
    https://devguide.python.org/#status-of-python-branches


    Why that specific date, @beardypig?

  9. malvinas2 commented on Apr 16, 2020

    @malvinas2
    Contributor

    @bastimeyer
    July 2nd... ==> 2.7 (as we already missed 7th of February, hahaha)

  10. hugovk commented on Apr 18, 2020

    @hugovk

    Please see PR #2919.

  11. wishfulguy commented on Apr 28, 2020

    @wishfulguy

    I have installed python 3.5, but streamlink still thinks that I'm using python 2.7
    May I ask what should I do?
    (I'm using Ubuntu 20.04)
    Thank you very much in advance

  12. beardypig commented on Apr 28, 2020

    @beardypig
    Member

    @wishfulguy depends how you installed streamlink, if you used pip you might need to use pip3.

  13. malvinas2 commented on Apr 28, 2020

    @malvinas2
    Contributor

    @wishfulguy
    or in case you clone the git repository replace python by python3:

    # Current user
    git clone https://github.com/streamlink/streamlink.git
    cd streamlink
    python3 setup.py install --user
    
    # System wide
    git clone https://github.com/streamlink/streamlink.git
    cd streamlink
    sudo python3 setup.py install
    
  14. bastimeyer commented on May 1, 2020

    @bastimeyer
    Member

    @beardypig Do you want to add the python2-removal branch (or whatever you want to call it) to the repo now? We've said that 1.4.0 was the "last" release with p2 support, so we should start removing python2 now. This parallel branch shouldn't live too long though, otherwise we'll have lots of merge conflicts.

  15. 4AM-Campfire commented on May 4, 2020

    @4AM-Campfire

    I’m on a Mac and I have limited technical knowledge and zero experience with Python. Trying to get streams running with Streamlink 1.4.1 was painful, I just lacked understanding on what it was that needed to be done, and once I did I had no idea how to go about doing it.

    I started off by install Python 3 from phython.org (version 3.8.2), and then ran the easy_install command to update to 1.4.1. This this didn’t work, I pointed Twitch GUI at Python 3 (via “which Python3” command) and still got errors. Googling about, I learnt that I needed to get Streamlink installed to Python 3. Then I hit a brick wall as I couldn’t understand anything that I tried to read on how to do it.

    The solution is that “easy_install” is a Python program, and that when you run it you are running the system default 2.7 version of it. I had zero clue that this was the case until by chance I saw that there was a file named “easy_install-3.8” in the Python 3 install folder. With this knowledge, I tried running “sudo easy_install-3.8 -U streamlink”, that installed it in the correct place and now I can watch streams again.

    I think with the abandonment of 2.7, you should add some clear steps in the documentation for how to handle this on a Mac. It’s simple if you know what you are dealing with, but as someone who was very much on the outside I had a real hard time with it.

  16. gravyboat commented on May 4, 2020

    @gravyboat
    Member

    @4AM-Campfire Thanks for the feedback. Homebrew is definitely the way to go in this scenario in terms of ease of use. @bastimeyer maybe we should move Homebrew to be the recommended option as the first entry in the list? Or mark Homebrew as the preferred option somehow? Then it's just an install of Homebrew and installing Streamlink will handle all the deps too.

  17. bastimeyer commented on May 4, 2020

    @bastimeyer
    Member

    We should remove the easy_install suggestion. It's long been deprecated and shouldn't be used at all. It's also questionable if it'll be available on future macOS versions, as they want to remove the system's default python env from what I remember, which includes setuptools, and which therefore includes easy_install.

    To be honest, I didn't notice that we were still mentioning it in the install docs, let alone having it listed as the first entry. In the Twitch GUI's install wiki (which also includes separate Streamlink instructions), I've explicitly never mentioned it.

  18. beardypig commented on May 4, 2020

    @beardypig
    Member

    @bastimeyer I think we should create a version-2 branch, and do all the changes we want for that there, including removal of Python 2.7. We mentioned before the removal of some deprecated options, etc.

    @gravyboat we really should :) We have easy_install listed for macOS, but then further down the page we have "Using easy_install is no longer recommended." :) For macOS I'd recommend using homebrew to install Streamlink.

  19. gravyboat commented on May 4, 2020

    @gravyboat
    Member

    @beardypig Yeah I only ever user Homebrew on my mac, I've never used easy_install for anything Python related.

  20. bastimeyer commented on Jun 5, 2020

    @bastimeyer
    Member

    It's been another month. We've already announced Streamlink's "last py2" release earlier, so we shouldn't drag this out any further and risk having another 1.x release.

    Since nobody has pushed the py2 removal forward so far, I guess we should keep it as simple as possible and not create a secondary branch. It's just too much effort keeping track of the changes which will happen simultaneously on the master branch until this gets merged.

    Let's remove py2 from the CI runners now, remove everything related to it from setup.py and afterwards strip out all the compatibility stuff and make the remaining code changes. We already have pull requests for that (#2920, #2921).

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions