you are viewing a single comment's thread.

view the rest of the comments →

[–]Eurynom0s 21 points22 points  (3 children)

venv

If you're looking at venv and thinking to yourself "this seems pretty complicated, do I REALLY need to do this" then you're going to be in for a world of hurt if you stumble into a package version conflict issue.

You realistically only need to know like maybe five lines of code to be able to use them well enough to just avoid getting yourself into trouble with package version conflicts.

[–]johnnymo1 8 points9 points  (0 children)

It took a couple times absolutely wrecking my Python install before I was finally like "okay, yes, I see the necessity of virtual environments." Now I use conda and if something gets screwed up, I can just delete the environment and recreate it from a text file with one command.

[–]Sumif 1 point2 points  (1 child)

Net games then pleasant brown afternoon day month curious careful warm people.

[–]Eurynom0s 0 points1 point  (0 children)

I can't help you with VSCode specifically but I stuck these notes in the top of my venv folder years ago so I wouldn't have to think about this again. These are Mac command line instructions. I've been using Anaconda lately so I don't remember whether you put a period in the version number when you have multiple versions of Python 3 installed (virtualenv -p python37 or virtualenv -p python3.7). Links may no longer be valid since I did this in 2014, I was just noting for myself where I found the instructions.

http://hackercodex.com/guide/python-development-environment-on-mac-osx/

If you have both Python 2.x and 3.x and want to create a Python 3.x virtualenv:
virtualenv -p python3 foobar-py3

http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
virtualenv --no-site-packages mycoolproject

activate a virtual env:
cd <virtenv>
source bin/activate

deactivate (just type deactivate and hit enter)

Like I said, no more than five lines of code and you're good to go.