#41549: python34 installs fails with Image error: /opt/local/bin/2to3 already exists --------------------+-------------------------------- Reporter: nad@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: | Port: python34 --------------------+-------------------------------- As of Python 3.4.0b1, the Makefile `altintstall` and `install` targets have changed somewhat. In particular, for framework builds, there is now a complete set of symlinks created in the prefix bin directory ( {{{/opt/local/bin}}} for all of the files created in the framework `bin` directory. See http://bugs.python.org/issue19649 for details. `make install` will create files that overlap between Python versions, for example, the generic `python3` symlink. Another case is `2to3` which, I believe, exists in all Pythons since 2.6. The "already exists" error occurs when installing `python34` if `python27` is already installed. (I'm using a non-standard MacPorts prefix, `/macports`, instead of `/opt/local`, and use the `+universal` variant.) {{{ :error:activate org.macports.activate for port python34 returned: Image error: /macports/bin/2to3 already exists and does not belong to a registered port. Unable to activate port python34. Use 'port -f activate python34' to force the activation. }}} Here is the set of files to be installed by the `python34` port into the `bin` directory: {{{ :info:activate x ./macports/bin/2to3 :info:activate x ./macports/bin/2to3-3.4 :info:activate x ./macports/bin/easy_install-3.4 :info:activate x ./macports/bin/idle3 :info:activate x ./macports/bin/idle3.4 :info:activate x ./macports/bin/pip3 :info:activate x ./macports/bin/pip3.4 :info:activate x ./macports/bin/pydoc3 :info:activate x ./macports/bin/pydoc3.4 :info:activate x ./macports/bin/python3 :info:activate x ./macports/bin/python3-32 :info:activate x ./macports/bin/python3-config :info:activate x ./macports/bin/python3.4 :info:activate x ./macports/bin/python3.4-32 :info:activate x ./macports/bin/python3.4-config :info:activate x ./macports/bin/python3.4m :info:activate x ./macports/bin/python3.4m-config :info:activate x ./macports/bin/pyvenv :info:activate x ./macports/bin/pyvenv-3.4 }}} I currently have `python27` and `python33` installed. Here is what the `/macports/bin` directory looks like: {{{ # ls -l /macports/bin/pytho* lrwxr-xr-x 1 root admin 23 Nov 25 21:06 /macports/bin/python@ -> /macports/bin/python2.7 lrwxr-xr-x 1 root admin 30 Nov 25 21:06 /macports/bin/python-config@ -> /macports/bin/python2.7-config lrwxr-xr-x 1 root admin 72 Nov 12 13:58 /macports/bin/python2.7@ -> /macports/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 lrwxr-xr-x 1 root admin 79 Nov 12 13:58 /macports/bin/python2.7-config@ -> /macports/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config lrwxr-xr-x 1 root admin 23 Aug 23 13:45 /macports/bin/python3@ -> /macports/bin/python3.3 lrwxr-xr-x 1 root admin 72 Nov 25 20:49 /macports/bin/python3.3@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3 lrwxr-xr-x 1 root admin 75 Nov 25 20:49 /macports/bin/python3.3-32@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-32 lrwxr-xr-x 1 root admin 79 Nov 25 20:49 /macports/bin/python3.3-config@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/python3.3-config lrwxr-xr-x 1 root admin 24 Nov 25 21:06 /macports/bin/pythonw@ -> /macports/bin/pythonw2.7 lrwxr-xr-x 1 root admin 73 Nov 12 13:58 /macports/bin/pythonw2.7@ -> /macports/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7 lrwxr-xr-x 1 root admin 73 Nov 25 20:49 /macports/bin/pythonw3.3@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3 lrwxr-xr-x 1 root admin 76 Nov 25 20:49 /macports/bin/pythonw3.3-32@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/pythonw3.3-32 # ls -l /macports/bin/2to* lrwxr-xr-x 1 root admin 22 Nov 25 21:06 /macports/bin/2to3@ -> /macports/bin/2to3-2.7 lrwxr-xr-x 1 root admin 71 Nov 12 13:58 /macports/bin/2to3-2.7@ -> /macports/Library/Frameworks/Python.framework/Versions/2.7/bin/2to3-2.7 lrwxr-xr-x 1 root admin 71 Nov 25 20:49 /macports/bin/2to3-3.3@ -> /macports/Library/Frameworks/Python.framework/Versions/3.3/bin/2to3-3.3 }}} Along with the `2to3` conflict, there will likely be conflicts between the `python33` and `python34` versions of the `3` links. Without thinking too much about it, I think the right approach would likely be to install with `make altinstall` rather then `make install` and then provide `port select python3` options and just special case `2to3`, perhaps giving preference to the Python 3.x version which should be newer. Also, note that Python 3.4.0b1 implements PEP 453 which by default installs a version of `pip` and its current dependency `setuptools`, which now show up in the bin directories and will conflict with the `py34-setuptools` port and `py34-pip` (when created). See http://bugs.python.org/issue19553 for more details. -- Ticket URL: <https://trac.macports.org/ticket/41549> MacPorts <http://www.macports.org/> Ports system for OS X