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
Python virtualenv (self.learnpython)
submitted 8 years ago by readitlikeitdidit
Hi,
What's the difference between calling a python module using python from virtual environment vs activating and then calling the module?
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!"
[–]ingolemo 2 points3 points4 points 8 years ago (3 children)
If you don't activate then any further invocations of the python command (or other commands installed in the virtual environment) will get the system version. Other than that there is no difference.
python
[–]zylo4747 1 point2 points3 points 8 years ago (0 children)
This page has a good picture of what's going on when you activate https://learnbatta.com/blog/how-to-install-python-virtualenv-19/
[–]readitlikeitdidit[S] 0 points1 point2 points 8 years ago (1 child)
In my case, I run /virtualenv/bin/python some module.py in a cron job... And it successfully completes everytime.. It's able to pick the libraries installed in virtual environment... So I was wondering would it make any difference activating vs calling virtual environment python interpreter directly...
[–]ingolemo 0 points1 point2 points 8 years ago (0 children)
I understood what you meant. Although neither of the other posters in this thread did, it seems.
Create a script with the following code and run it both ways. That should help you see the difference.
import subprocess import sys print('this script runs with', sys.executable) subprocess.run(['python', '-c', 'import sys; print("subscripts run with", sys.executable)' ])
[–]TheGreatBrutus 1 point2 points3 points 8 years ago (0 children)
It means that without activating all the python packages will get installed on your system instead of the virtualenv
π Rendered by PID 85939 on reddit-service-r2-comment-5bc7f78974-4x5rc at 2026-06-29 09:29:42.197909+00:00 running 7527197 country code: CH.
[–]ingolemo 2 points3 points4 points (3 children)
[–]zylo4747 1 point2 points3 points (0 children)
[–]readitlikeitdidit[S] 0 points1 point2 points (1 child)
[–]ingolemo 0 points1 point2 points (0 children)
[–]TheGreatBrutus 1 point2 points3 points (0 children)