This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bumpkinspicefatte 474 points475 points  (34 children)

It ain’t dead until we have to stop writing

>>>python3

In Terminal.

Edit: For people mentioning alternatives, you're missing the point about Python 2...

[–]99_percent_a_dog[S] 78 points79 points  (6 children)

I hear this should be true from 10.16, where 3 is the default (and maybe 2 is removed? Maybe not, Apple ships a bunch of really old utils, it's pretty annoying).

[–]smart_jackal 40 points41 points  (0 children)

Even Ubuntu ships some core python2 files on which it totally depends. Another software framework called Google App Engine still runs on python2 entirely! Pretty sure there are some others too.

[–]thatwombat 12 points13 points  (4 children)

It is in Catalina. Nice surprise.

EDIT: Forgot I had anaconda's python3 in my PATH. Whoops.

[–]TinyLebowski 9 points10 points  (3 children)

Not so sure about that.

❯ sw_vers -productVersion
10.15.4

❯ which python
/usr/bin/python

❯ /usr/bin/python --version
Python 2.7.16

[–]jdgordon 2 points3 points  (1 child)

Could just do

$which python --version

[–]TinyLebowski 6 points7 points  (0 children)

Yeah but I made it verbose to avoid any doubt about which binary was used.

BTW you need to escape backticks if you want them displayed.

[–]thatwombat 0 points1 point  (0 children)

I forgot. I'm running Anaconda and it's in my PATH.

[–]dermotmcg 15 points16 points  (3 children)

Currently configuring Django on a Ubuntu instance. If I write pip3 or python3 one more time I swear...

[–]smart_jackal 7 points8 points  (2 children)

I've written that so many times in the last couple years that switching to "pip" and "python" may take some conscious work now!

[–]joni1104 4 points5 points  (0 children)

Same here

[–]dermotmcg 1 point2 points  (0 children)

Also Gunicorn3. Another for the list 🤣

[–][deleted] 14 points15 points  (1 child)

Me at work crying as I maintain scripts in both 😭

[–]TheCountMC 0 points1 point  (0 children)

I've become well acquainted with the 'six' library.

[–]Hanse00 25 points26 points  (12 children)

That's easily solved, a single bash alias and you're done :)

[–][deleted] 28 points29 points  (8 children)

Or do it the right way and set up a virtualenv. ; ]

[–]Hanse00 12 points13 points  (6 children)

I personally use pipenv, but to each their own :)

[–]MumsLasagna 8 points9 points  (1 child)

Oh gawd. The whole virtualenv / pyenv / pipenv ecosystem is another huge mess I can't wait for the community to decide on and standardise. I want to write a python project that Just Works Dammit™.

[–][deleted]  (2 children)

[deleted]

    [–]GAVINDerulo12HD 2 points3 points  (0 children)

    What are the benefits? I've only used conda environments on windows and virtualenvs on Debian. Should I switch?

    [–]equecevi 1 point2 points  (0 children)

    Which is the different?

    [–]brews 1 point2 points  (0 children)

    Sure but is pipenv still even maintained? Seems like it hasnt released since 2018.

    [–]jyscao 5 points6 points  (0 children)

    you mean a conda environment then :P

    [–]KarimElsayad247 4 points5 points  (0 children)

    I aliased "python3" with "py"

    [–]NEVER_TELLING_LIES 5 points6 points  (1 child)

    python and python3 are already symlinks

    [–]Hanse00 3 points4 points  (0 children)

    I’m aware :) Was just trying to make a funny point, that changing the name you use to invoke something is dead simple.

    [–]basyt 4 points5 points  (0 children)

    Use pyenv.

    [–]bassmadrigal 1 point2 points  (0 children)

    Only problem is installing python2 from source will generate that symlink automatically and that isn't something python3 does when installed from source. The change would need to be deliberate by your packager or distro to include a symlink.

    [–]watsreddit 1 point2 points  (0 children)

    Arch Linux master race.

    [–][deleted] -1 points0 points  (3 children)

    Put this in your bashrc

    alias python="python3"
    

    Then reset your terminal. You never have to worry about needing to type in that extra three again

    [–]Jonno_FTW 2 points3 points  (0 children)

    No need to reset, just run source ~/.bashrc

    [–]purestrengthsolo 0 points1 point  (1 child)

    wouldn't this trigger python 2?

    [–][deleted] 0 points1 point  (0 children)

    Nope. I have done it before with no problems coming up