Selecting python3.4

Mojca Miklavec mojca at macports.org
Tue Nov 25 01:23:15 PST 2014


Hi,

I'm a bit confused by the behaviour of starting the python. I tried to
select python with
> sudo port select python python34
Selecting 'python34' for 'python' succeeded. 'python34' is now active.

But it behaves a bit weird, it doesn't give me the version 3.4:

> python --version
Python 2.7.1

Other commands:

> /usr/bin/python --version
Python 2.7.1
> which python
/opt/local/bin/python
> /opt/local/bin/python --version
Python 3.4.2
> ll /opt/local/bin/python
... /opt/local/bin/python -> /opt/local/bin/python3.4

How is it possible that "python --version" runs the version 2.7 instead of 3.4?

-----------

It might be relevant that I initially had unexplainable problems with:

> sudo port select python python34
Selecting 'python34' for 'python' failed: symlink:
/opt/local/etc/select/python/current -> python34: file already exists
> ll /opt/local/etc/select/python/current
lrwxr-xr-x  1 root  admin  8  4 jul 14:07
/opt/local/etc/select/python/current -> python33
> sudo port select python none
Selecting 'none' for 'python' failed: symlink:
/opt/local/etc/select/python/current -> none: file already exists

So I did
> sudo rm /opt/local/etc/select/python/current
which was necessary to make the "port select" work in the first place.
I don't know why that happened, but it is true that I deactivated (or
uninstalled) python3.3 recently, so maybe that uninstallation
interfered with port select in some way.

Still I don't understand why that would have any effect in the first place.

Thank you,
    Mojca


More information about the macports-users mailing list