I am getting dreadful warnings about my version of python when I run pip. So I asked about this with the developers of the script I use (xml2rfc). I bit of version testing and:
$ pip --version pip 19.0.3 from /usr/lib/python2.7/site-packages/pip (python 2.7) $ pip2 --version pip 19.0.3 from /usr/lib/python2.7/site-packages/pip (python 2.7) $ pip3 --version pip 19.0.3 from /usr/lib/python3.7/site-packages/pip (python 3.7)
and
$ ls -ls /usr/bin/pip* 4 -rwxr-xr-x. 1 root root 408 Jul 17 04:23 /usr/bin/pip 0 lrwxrwxrwx. 1 root root 9 Jul 17 04:23 /usr/bin/pip-2 -> ./pip-2.7 4 -rwxr-xr-x. 1 root root 408 Jul 17 04:23 /usr/bin/pip2 0 lrwxrwxrwx. 1 root root 8 Jul 17 04:23 /usr/bin/pip-2.7 -> ./pip2.7 4 -rwxr-xr-x. 1 root root 408 Jul 17 04:23 /usr/bin/pip2.7 0 lrwxrwxrwx. 1 root root 9 Jul 17 04:23 /usr/bin/pip-3 -> ./pip-3.7 4 -rwxr-xr-x. 1 root root 408 Jul 17 04:23 /usr/bin/pip3 0 lrwxrwxrwx. 1 root root 8 Jul 17 04:23 /usr/bin/pip-3.7 -> ./pip3.7 4 -rwxr-xr-x. 1 root root 408 Jul 17 04:23 /usr/bin/pip3.7 24 -rwxr-xr-x. 1 root root 22816 Jun 19 10:44 /usr/bin/pipewire
so pip does not seem to be a symlink to pip2, but perhaps just a copy?
I suspect I will still be running F30 come Jan 2020 when Python 2.7 gets the axe:
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Do I need to do anything, or will this be self-correcting come the new year?
thanks
On Thu, 29 Aug 2019 16:02:25 -0400 Robert Moskowitz wrote:
Do I need to do anything, or will this be self-correcting come the new year?
I forget where (maybe in redhat rather than fedora), but some distro has utterly removed /usr/bin/python all it has now is /usr/bin/python2 or /usr/bin/python3 and your scripts need to explicitly refer to one or the other.
On 8/29/19 4:14 PM, Tom Horsley wrote:
On Thu, 29 Aug 2019 16:02:25 -0400 Robert Moskowitz wrote:
Do I need to do anything, or will this be self-correcting come the new year?
I forget where (maybe in redhat rather than fedora), but some distro has utterly removed /usr/bin/python all it has now is /usr/bin/python2 or /usr/bin/python3 and your scripts need to explicitly refer to one or the other.
So no more just pip. It is pip3.
xml2rfc claims it works just fine with either.
On 29Aug2019 16:20, Robert Moskowitz rgm@htt-consult.com wrote:
On 8/29/19 4:14 PM, Tom Horsley wrote:
On Thu, 29 Aug 2019 16:02:25 -0400 Robert Moskowitz wrote:
Do I need to do anything, or will this be self-correcting come the new year?
I forget where (maybe in redhat rather than fedora), but some distro has utterly removed /usr/bin/python all it has now is /usr/bin/python2 or /usr/bin/python3 and your scripts need to explicitly refer to one or the other.
So no more just pip. It is pip3.
xml2rfc claims it works just fine with either.
These days the advice is to use:
python -m pip
adjusting "python" as desired. That way you get the pip that affects your intended python install.
Cheers, Cameron Simpson cs@cskk.id.au
On 8/29/19 4:41 PM, Cameron Simpson wrote:
On 29Aug2019 16:20, Robert Moskowitz rgm@htt-consult.com wrote:
On 8/29/19 4:14 PM, Tom Horsley wrote:
On Thu, 29 Aug 2019 16:02:25 -0400 Robert Moskowitz wrote:
Do I need to do anything, or will this be self-correcting come the new year?
I forget where (maybe in redhat rather than fedora), but some distro has utterly removed /usr/bin/python all it has now is /usr/bin/python2 or /usr/bin/python3 and your scripts need to explicitly refer to one or the other.
So no more just pip. It is pip3.
xml2rfc claims it works just fine with either.
These days the advice is to use:
python -m pip
adjusting "python" as desired. That way you get the pip that affects your intended python install.
Which goes really nicely into the next question.
It seems the default right now is 2.7:
$ python --version Python 2.7.16
Will this automagically change on Jan 1, 2020?
$ python3 --version Python 3.7.4
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
On 29Aug2019 16:54, Robert Moskowitz rgm@htt-consult.com wrote:
These days the advice is to use: python -m pip
adjusting "python" as desired. That way you get the pip that affects your intended python install.
Which goes really nicely into the next question.
It seems the default right now is 2.7:
$ python --version Python 2.7.16
Will this automagically change on Jan 1, 2020?
Probably not? But I'm guessing, not speaking from knowledge.
$ python3 --version Python 3.7.4
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
Well, you could move /usr/bin/python sideways (so that it could be put back) and install a symlink to whichever Python executable you want to test.
Keep in mind that yum and dnf are implemented in Python, so while that symlink is nonstandard badness may ensue.
Cheers, Cameron Simpson cs@cskk.id.au
On Thu, 29 Aug 2019 at 17:56, Robert Moskowitz rgm@htt-consult.com wrote:
On 8/29/19 4:41 PM, Cameron Simpson wrote:
On 29Aug2019 16:20, Robert Moskowitz rgm@htt-consult.com wrote:
On 8/29/19 4:14 PM, Tom Horsley wrote:
On Thu, 29 Aug 2019 16:02:25 -0400 Robert Moskowitz wrote:
Do I need to do anything, or will this be self-correcting come the new year?
I forget where (maybe in redhat rather than fedora), but some distro has utterly removed /usr/bin/python all it has now is /usr/bin/python2 or /usr/bin/python3 and your scripts need to explicitly refer to one or the other.
So no more just pip. It is pip3.
xml2rfc claims it works just fine with either.
These days the advice is to use:
python -m pip
adjusting "python" as desired. That way you get the pip that affects your intended python install.
Which goes really nicely into the next question.
It seems the default right now is 2.7:
$ python --version Python 2.7.16
Will this automagically change on Jan 1, 2020?
$ python3 --version Python 3.7.4
The python people recommended keeping python for python 2, and using python3 for python 3. Unfortunately, at least one prominent python package, anaconda, uses python for python 3.
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
https://python-3-for-scientists.readthedocs.io/en/latest/ has lots of useful information.
Python packages that are actively maintained are being converted to use python 3. In many cases this can be done in a way that allows the code to use either python 2 or python3. The problem comes with older, unmaintained packages. Often these are orphaned because there is something better you should be using, for some definition of "better". The major reason for python 3 was to better support unicode, so linux distributions with global reach needed python 3.
There has been a global shift in the importance of Chinese, Korean, and Japanese (CJK) language customers to Western vendors. Python 3 is one consequence, but we also have lualatex and unicode fonts in place of Postscript. Western companies selling in CJK markets need unicode for web sites, manuals, and the software they distribute.
A while ago I compared lists of python 2 and python 3 packages for Ubuntu. The python 2 list was much longer, but there were only a few python 2 packages installed that did not have python 3 versions. You might find a similar exercise useful for Fedora.
On 8/29/19 1:54 PM, Robert Moskowitz wrote:
Will this automagically change on Jan 1, 2020?
No, but it will be changed in Fedora 31: https://fedoraproject.org/wiki/Changes/Python_means_Python3
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
If you're using only packaged python applications, everything should be fine. If you have your own in /usr/local or some other local root directory, you will probably want to check for newer versions and re-install them. You can do that now, and you should use either the "python2" or "python3" command when doing so.
On 8/30/19 3:45 PM, Gordon Messmer wrote:
On 8/29/19 1:54 PM, Robert Moskowitz wrote:
Will this automagically change on Jan 1, 2020?
No, but it will be changed in Fedora 31: https://fedoraproject.org/wiki/Changes/Python_means_Python3
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
If you're using only packaged python applications, everything should be fine. If you have your own in /usr/local or some other local root directory, you will probably want to check for newer versions and re-install them. You can do that now, and you should use either the "python2" or "python3" command when doing so.
The only non Fedora packaged python app I am running is xml2rfc.
This is what the IETF community tends to use to create Internet Drafts. Many of us prefer writing in xml. Many prefer Markdown and have an app that converts their .md to .xml. There are a few (some Chinese) that still use Word and create .txt which then needs cleanup. Then there are those that insist that they NEED pdf images for their RFCs (but they are REQUIRED to also generate ascii graphics and .txt versions).
Fun for all. Your RFCs in the making. Like any sausage, you probably don't want to know what we put into them.
:)
On Fri, 30 Aug 2019 at 19:22, Robert Moskowitz rgm@htt-consult.com wrote:
On 8/30/19 3:45 PM, Gordon Messmer wrote:
On 8/29/19 1:54 PM, Robert Moskowitz wrote:
Will this automagically change on Jan 1, 2020?
No, but it will be changed in Fedora 31: https://fedoraproject.org/wiki/Changes/Python_means_Python3
Is there a way to get it changed now and see what is in trouble (though there is very little python that I know I am using).
If you're using only packaged python applications, everything should be fine. If you have your own in /usr/local or some other local root directory, you will probably want to check for newer versions and re-install them. You can do that now, and you should use either the "python2" or "python3" command when doing so.
There are now many more python3 than python2 packages:
$ dnf list python2-* > python2-rpm.list $ dnf list python3-* > python3-rpm.list $ wc -l python*.list 899 python2-rpm.list 2648 python3-rpm.list 3547 total
Some common packages (matplotlib) have newer versions for python3 that for python2.
The only non Fedora packaged python app I am running is xml2rfc.
The changelog indicates support for python 2 and 3. The docs mention using WeasyPrint to generate PDF's, -- also appears not to have fedora packages.
You can use:
$ python3 -m pip install --user xml2rfc [...] Successfully installed certifi-2019.6.16 chardet-3.0.4 google-i18n-address-2.3.5 html5lib-1.0.1 idna-2.8 intervaltree-3.0.2 kitchen-1.2.6 lxml-4.4.1 pycountry-19.8.18 pyflakes-2.1.1 requests-2.22.0 sortedcontainers-2.1.0 urllib3-1.25.3 webencodings-0.5.1 xml2rfc-2.25.0
As you see, this pulls in a bunch of packages, many of which should be in the list of python3 packages. For some use cases it would be better to use as many of the distro packages as possible so you don't have to track updates on all those packages.
This is what the IETF community tends to use to create Internet Drafts. Many of us prefer writing in xml. Many prefer Markdown and have an app that converts their .md to .xml. There are a few (some Chinese) that still use Word and create .txt which then needs cleanup. Then there are those that insist that they NEED pdf images for their RFCs (but they are REQUIRED to also generate ascii graphics and .txt versions).
Fun for all. Your RFCs in the making. Like any sausage, you probably don't want to know what we put into them.
:)
If xml2rfc screws up you will probably notice right away -- what keeps
me up at night are the calculations where there is no easy way to detect an error, so you really have to watch for bug reports on key packages.
Am 31.08.19 um 02:45 schrieb George N. White III:
The changelog indicates support for python 2 and 3. The docs mention using WeasyPrint to generate PDF's, -- also appears not to have fedora packages.
Weasyprint is packaged in Fedora - though with an pretty old version: https://src.fedoraproject.org/rpms/weasyprint
Right now I am waiting that a required package is imported into Fedora [1]. Afterwards I should be able to update Weasyprint to the latest version (maybe only F32, depends on when we get python3-cssselect2 in Fedora).
Felix
Am 29.08.19 um 22:20 schrieb Robert Moskowitz:
So no more just pip. It is pip3.
Not 100% correct. In newer Fedora versions "/usr/bin/pip" refers to the Python 3 version of "pip". No need to use "pip3". Actually F32 does not contain any Python 2 version of "pip" at all. (I could only check "rawhide" aka Fedora 32 right now - so maybe this is different for Fedora 31.)
Felix