#34326: Python ports do not adhere to PEP 394 and provide "python2" and "python3" -------------------------------------------------+------------------------- Reporter: mikko@… | Owner: larryv@… Type: enhancement | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.0.4 Resolution: fixed | Keywords: Port: python_select python24 python25 | python26 python27 python31 python32 python33 | python34 | -------------------------------------------------+------------------------- Changes (by larryv@…): * status: assigned => closed * resolution: => fixed Comment: These should do it. Thanks to Ned Deily for upstream-flavored feedback. - [136723] — Allow ports to easily install multiple select files. - [136741,136743,136745] — Create `python2` select group for Python 2.6 and 2.7. - [136748:136749] — Create `python3` select group for Python 3.3–3.5. Selecting the default Python 2 and 3 works just like selecting the default Python always has. The three groups are independent: Changing one selection does not affect the others. View your options: {{{ % port select --list python Available versions for python: none (active) python24 python26 python26-apple python27 python27-apple python31 python32 python33 python34 python35 % port select --list python2 Available versions for python2: none (active) python26 python26-apple python27 python27-apple % port select --list python3 Available versions for python3: none (active) python33 python34 python35 }}} Make selections: {{{ % sudo port select --set python python26 Selecting 'python26' for 'python' succeeded. 'python26' is now active. % sudo port select --set python2 python27-apple Selecting 'python27-apple' for 'python2' succeeded. 'python27-apple' is now active. % sudo port select --set python3 python35 Selecting 'python35' for 'python3' succeeded. 'python35' is now active. }}} As you’d expect: {{{ % /opt/local/bin/python -V Python 2.6.9 % /opt/local/bin/python2 -V Python 2.7.6 % /opt/local/bin/python3 -V Python 3.5.0b1 }}} The links vary by group and port. To see which links are being created, look at the debug output: {{{ % sudo port -d select --set python3 python34 DEBUG: Copying /Users/larryv/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences DEBUG: action_select [python3 python34] [ports_source_only yes ports_select_set yes]... DEBUG: The 'set' command was specified. DEBUG: mportselect [set] [python3] [python34] DEBUG: ln -sf /opt/local/bin/python3.4 /opt/local/bin/python3 DEBUG: ln -sf /opt/local/bin/python3.4m /opt/local/bin/python3m DEBUG: ln -sf /opt/local/bin/python3.4-32 /opt/local/bin/python3-32 DEBUG: rm -f /opt/local/bin/pythonw3 DEBUG: rm -f /opt/local/bin/pythonw3-32 DEBUG: ln -sf /opt/local/bin/python3.4-config /opt/local/bin/python3-config DEBUG: ln -sf /opt/local/bin/python3.4m-config /opt/local/bin/python3m- config DEBUG: ln -sf /opt/local/bin/idle3.4 /opt/local/bin/idle3 DEBUG: ln -sf /opt/local/bin/pydoc3.4 /opt/local/bin/pydoc3 DEBUG: ln -sf /opt/local/bin/2to3-3.4 /opt/local/bin/2to3-3 DEBUG: ln -sf /opt/local/bin/pyvenv-3.4 /opt/local/bin/pyvenv DEBUG: ln -sf /opt/local/share/man/man1/python3.4.1 /opt/local/share/man/man1/python3.1 Selecting 'python34' for 'python3' succeeded. 'python34' is now active. DEBUG: Checking time since last reclaim run }}} We are in the process of removing the `python{24,25,31,32}` ports, so they are not available as choices for the new `python2` and `python3` groups. As usual, run `sudo port selfupdate` to receive these changes. Please open a new ticket to report bugs or request enhancements. -- Ticket URL: <https://trac.macports.org/ticket/34326#comment:37> MacPorts <https://www.macports.org/> Ports system for OS X