2 ms·
Folks have given a number of good options here, but I thought I'd mention some other ones in case they're helpful for your use case. 1) docker! If you only pla
by cdrini 5y ago
Folks have given a number of good options here, but I thought I'd mention some other ones in case they're helpful for your use case.
1) docker! If you only plan on tinkering with something and don't want to install a bunch of random things on your machine, this command will start a python 2 image with access to the current directory: `docker run --rm -it -v "$PWD:/app" python:2.7 bash` (IIRC, on my phone atm!) (Windows users will need to write `"/$PWD://app"` if using mingw/etc). Once inside, you can pip install, etc, and it'll all go away once you exit the terminal! If you want it to stick around, don't use --rm and add a --name to give it a name you can remember for later. It does require learning some docker, but it's a good investment :) I use the same technique to try out/play with other languages, versions, packages, etc. without making complicated mods to my actual computer. And there might even be docker images that come with certain packages/etc pre-installed for certain use cases!
2) Pycharm! A good python IDE, with virtualenv support baked in if you don't feel like playing around with a bunch of commands at all. Although disclaimer, I can't fully remember how hard it was to get things setup (or how easy it is to work with multiple python versions), so YMMV.
- RheingoldRiver 5y agoI don't think Pycharm will install different versions for you, but if you have multiple versions installed, it is indeed super easy to switch between them. Though if you have a ton of packages you'll have to reinstall them all for the right version, and if you're dealing with lots of venvs + system installs, you have to make sure to choose the right thing from the dropdown and you might get somewhat lost and confused if you don't know what you're doing. The right menu is File -> Settings -> Project: <your project name> -> Project Interpreter, and then you pick whatever you want by Python Interpreter. In Windows I use Chocolatey to manage Python versions, in Mac idk though.
- rlayton2 5y agoIt does install them too - however I have the pro version, and I'm not sure if that's a pro feature or not.
- RheingoldRiver 5y agoIt installs versions of Python or versions of packages? I can't find anything in the docs about installing versions of Python, just packages (which I've done on occasion, when I'm really confused about why my environment isn't working, I also have pro version now but I'm pretty sure I'd done it when I had community version too)
- rlayton2 5y agoAh, just checked. I thought it installed python versions as well, but it can create environments (virtualenv, conda, system pythons, pipenv, docker), and can install packages in those environments. I do not see a way to install a whole new python version (only the ability to add to the list, which requires you to select the interpreter from an open file dialog)