Talk:Python

From ArchWiki
Jump to: navigation, search

Python 2 and 3

Python#Python_3 doesn't mention http://python-future.org/ . It has been recently added to the repos: python-future. I know nothing about python, so I just dropped a note here. -- Karol (talk) 10:54, 30 August 2015 (UTC)

I know python well, but I don't know what's "python-future" xD We can add info about it if another users say it's a good idea -- Kycok (talk) 13:19, 30 August 2015 (UTC)
__future__ allows you to use python3 syntax in python2 scripts. Looking at the file list of python-future this is a step up from that. -- Alad (talk) 19:27, 30 August 2015 (UTC)
To me it seems like a regular Python package (with rather self-assured name), providing tools similar to the older and limited 2to3 tool. It's not a new implementation or something like that, the future of Python is to switch to the 3 branch completely. I have no idea why they still (unofficially) backport everything to the 2 branch, thus delaying the inevitable. -- Lahwaacz (talk) 19:59, 30 August 2015 (UTC)
"allows you to use python3 syntax in python2 scripts"
So, we can add it in "Dealing with version problem in build scripts" and/or "Tips and tricks" section(s) temporarily, while python2 is widely used -- Kycok (talk) 20:15, 30 August 2015 (UTC)
That section is targeted at packagers, dealing mainly with the python -> python3 symlink. As far as I understand, the code has to be written explicitly for python-future (or converted automatically and checked) in order to use their features, it can't be used by packagers just for building the packages. -- Lahwaacz (talk) 20:23, 30 August 2015 (UTC)

Useful tip for package conflicts with pip?

I found a useful little one-liner that will give you all python packages installed site-wide that are not from a pacman package, and think it might be a useful thing to add?

 pacman -Qo /usr/lib/python*/site-packages/* | grep 'No package owns'

Mistfox (talk) 23:29, 16 August 2016 (UTC)

Using pip to install into /usr/lib/ is discouraged. There is Pacman/Tips_and_tricks#Identify_files_not_owned_by_any_package for general cleanup. -- Lahwaacz (talk) 14:32, 17 August 2016 (UTC)

"Using pip is not recommended on Arch": source?

After seeing the following edit by Alad and above comment by Lahwaacz, I was wondering if we could get a source on the general assertion "installing Python packages via pip is not recommended on Arch". I don't mind it all, but I'd rather not assert such policy without basis. Thanks. Neitsab (talk) 13:42, 28 October 2016 (UTC)

It doesn't mean that pip is not recommended at all, it's just that everything under /usr/lib/ should be under pacman control. Using pip in virtual environment or pip install --user is completely fine, but the default behaviour of installing into /usr/lib/ is not. -- Lahwaacz (talk) 14:30, 28 October 2016 (UTC)