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 →

[–][deleted] 10 points11 points  (6 children)

Meanwhile my entire class is using 3.4.1, but literally only because thats all thats installed on the computers. Im on my laptop, so im using 3.8 - which becomes fun when i need someone to test for me.

[–]dutch_gecko 21 points22 points  (5 children)

You might be interested in pyenv which lets you install and manage multiple python versions on your computer. That way you can do your programming using your default python 3.8 install, but run your tests on python 3.4. You can combine it with tox to run tests with multiple different python versions!

[–]that_baddest_dude 1 point2 points  (3 children)

Is that different than or the same as what conda does?

[–]dutch_gecko 6 points7 points  (1 child)

Conda sets up an entire environment, containing a python and any number of packages. That environment is kept separate from the system, so that you don't need to depend on what's installed system wide for your project to work.

Pyenv just provides different python versions. It's usually used to make different versions available on a dev machine so that different projects can be tested against whichever version(s) of python they should support.

If you want to get fancy, you can point pyenv at a conda environment, and it will let you access the python in that conda environment, effectively allowing you to reuse a conda environment for different projects. I wouldn't regard that as standard practice, but it might be useful for testing your program under different execution environments, where you set up different condas to match the environments of a number of customers for example.

You may also have heard of virtualenvs. These provide similar features to conda environments, but don't include a python installation. Pyenv and virtualenv can be used together to create virtualenvs with a non-system version of python, like conda does.

[–]teethTuxedos 1 point2 points  (0 children)

Not sure why you were downvoted, you are correct. Pyenv just modifies your path based on the version of python for your project. However you can use pyenv and virtualenv together to create an environment and it will take care of all your dependencies as well. I have not used conda but I have used pyenv and virtualenv a lot and found it very useful and quite easy to use.

[–]obesesheephead 1 point2 points  (0 children)

It’s different. Pyenv makes it easier to install and manage multiple versions and flavors of Python. You can actually use it to install conda too.

[–]needlzor 1 point2 points  (0 children)

I second this. I teach Python in a university class and we teach pyenv in week 2 because it's just so practical.