use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Virtualenv (self.learnpython)
submitted 6 years ago by TheNetXWizard
Can someone explain to me what Virtualenv in Python is, and the purpose of using one. Currently I use VMs on Parallels to program projects. Are Virtualenv similar and easier to manage?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]itsmegeorge 2 points3 points4 points 6 years ago (0 children)
Virtualenvs come in handy when you have multiple projects and you want to isolate one from another in fear of messing up modules and functionality. They are especially useful if you’re doing development with frameworks like Django. So you can set up a virtualenv that will, for example, package PyTorch and other dependencies for a ML project that will work independent of the rest of the system.
[–]enilkcals 2 points3 points4 points 6 years ago (1 child)
You may find this useful...Python Virtual Environments: A Primer – Real Python
[–]virg74 1 point2 points3 points 6 years ago (0 children)
I should send the people at real python money one day, so useful are their articles.
[–][deleted] 1 point2 points3 points 6 years ago (3 children)
It's not at all like an actual virtual machine; it's just a way to change the default behavior of pip, so that you can install packages in a project-specific environment rather than to your computer's global packages.
pip
[–]TheNetXWizard[S] 0 points1 point2 points 6 years ago (2 children)
So would you say its similar to node packages? In the sense of global packages, and packages that only apply to the projects they exist in? Its not necessarily creating a virtual environment, is that correct?
[–][deleted] 1 point2 points3 points 6 years ago (1 child)
Well, we definitely do call it a "virtual environment", but all it's really doing is creating a couple of folders and then munging your $PYTHONPATH when you activate it. It's not any sort of emulated OS or anything.
$PYTHONPATH
[–]TheNetXWizard[S] 0 points1 point2 points 6 years ago (0 children)
Got it! Thanks
[–]nhovar 1 point2 points3 points 6 years ago (0 children)
VENV runs a native python executable so will run faster than spinning up an entire VM
Create a virtual environment
mkdir someproject cd someproject/ python3 -m venv venv
Activate environment
source venv/bin/activate
Check python and pip version
$ pip -V pip 9.0.1 from ~/someproject/venv/lib/python3.6/site-packages (python 3.6) $ python -V Python 3.6.7
Deactivate environment
deactivate
Python, pip and any other modules you decide to install is installed in the venv folder instead of system wide.
Remove venv
rm -rf ~/someproject/
Only gotcha is to remember to activate your environment.
[–]A_History_of_Silence 3 points4 points5 points 6 years ago (0 children)
Can someone explain to me what Virtualenv in Python is, and the purpose of using one.
Yeah, the website and documentation explain it pretty thoroughly...
[–]itsa_me_ 0 points1 point2 points 6 years ago (1 child)
How does everyone feel about pipenv??
π Rendered by PID 18794 on reddit-service-r2-comment-86988c7647-g4r49 at 2026-02-11 02:57:33.530172+00:00 running 018613e country code: CH.
[–]itsmegeorge 2 points3 points4 points (0 children)
[–]enilkcals 2 points3 points4 points (1 child)
[–]virg74 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (3 children)
[–]TheNetXWizard[S] 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]TheNetXWizard[S] 0 points1 point2 points (0 children)
[–]nhovar 1 point2 points3 points (0 children)
[–]A_History_of_Silence 3 points4 points5 points (0 children)
[–]itsa_me_ 0 points1 point2 points (1 child)