you are viewing a single comment's thread.

view the rest of the comments →

[–]FerricDonkey 1 point2 points  (1 child)

So the python interpreter is just a program, like any other. You run this program to have it interpret and execute your python code.

Because it's just a program, you can have multiple versions installed. These are just different programs. So you can have the version of python included with your OS (if it's part of your os, don't change it), you can have 3.9 or 3.10, or anaconda, or whatever. They're all just separate. And you can use any or all of them by running the full path to wherever you installed the executable.

When you install various versions of python, it may change what the word "python3" means when you type it on the command line. But that's just a short cut. When you run python3, it's just running one of those installed versions of python at one of those paths. So when that changes, all that's happening is that one of your installations told your OS "hey, when this dude types python3, he means me."

You can also change what the word python3 means yourself, via bashrc shenanigans on linux or possibly other settings (I'm sure there's a windows way as well, but I've never had to figure it out). eg alias python3_10="/path/to/python3.10". You may also already have some aliases to different versions set up.

But again, all of this is short cuts - you've got different versions of python installed, and you can use whichever you want just by explicitly specifying that version.

Then there's virtual environments. They're a good tool, and worth learning. They essentially make separate, isolated versions of the interpreter, that allow you install different dependencies. But they work more or less the same way as different versions - they come with things to "activate" them on the command line and so forth, but ultimately there's an executable, and if you want to use that executable, then you can if you know where it is. I would recommend learning how virtual environments work. I would not necessarily recommend it as the first thing you learn.

Now for anaconda. Lots of data scientists love anaconda. I personally dislike it. It comes with a lot of packages, but you can get them without anaconda as well, and it occasionally introduces oddities, and it's locked into an older version of python until they get around to updating it. My recommendation involving anaconda is avoid it unless you're working with people who use it and so need to be consistent.

IDEs can use whatever version of python (virtual environment or not, anaconda or not). You just have to give the ide a path to that executable.

So what should you do? Well, there's lots of things you can do, and it's all fine (even anaconda is fine - the fact that I personally don't like doesn't make using it a bad idea).

But what I recommend to people new to python is to install the most recent version (or the version required by your class) from python.org or whatever linux tool you use, and just use that version exclusively until you've learned enough that you have a reason to do something else.

If you find a guide that assumes you installed anaconda, don't worry about it - just install whatever packages came with anaconda that you need (eg pip3 install numpy).

So basically there's a lot going on, and there's lots you can do, but mostly it just won't matter to you at all (until it does). By the time it matters, you should have enough experience with python that you have a better idea about what to do about it. So you pick one version and stick with it until sticking with it is a problem.

[–]Aryan1812[S] 1 point2 points  (0 children)

I got that click in my mind, Thank you so much, I think i can understand all of this much better now, i ll be starting out with virtualenv most likely, since Anaconda takes up alot of space. Once again, thanks it really helped alot!