Selecting python3.4

Mojca Miklavec mojca at macports.org
Tue Nov 25 02:13:26 PST 2014


On Tue, Nov 25, 2014 at 10:30 AM, Andreas Kusalananda Kähäri wrote:
>
> I don't know if I'm totally off track here, but the shell caches the
> location of binaries.  You may have to do "hash -r" (or restart the
> shell).

Hi,

Indeed. Starting a new shell or running "hash -r" fixed the problem.
Weird, I didn't know that binary locations are cached.

Thanks a lot for the pointer, problem solved.

Mojca

> On Tue, Nov 25, 2014 at 10:23:15AM +0100, Mojca Miklavec wrote:
>> 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?
>>
>> Thank you,
>>     Mojca


More information about the macports-users mailing list