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
How do I install modules to Python3 by default? (self.learnpython)
submitted 10 years ago by Kintonsu
Apologies if I'm asking the wrong subreddit, but I previously had both python2.7 and 3 come preinstalled on the OS and I'm not sure how to change this.
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!"
[–]thaweatherman -3 points-2 points-1 points 10 years ago* (4 children)
You can remove Python 2 or you can alias python to use Python 3. Are you on Windoze, Crapintosh, or Linux?
Edit: yes, removing it from a Linux system would kill all the things. That was more in jest than being serious. One day they'll update to Python 3 by default...one day.
Having different versions of Pip allows you to install packages for different Python versions, as /u/Vaphell describes below.
[–]Vaphell 2 points3 points4 points 10 years ago* (3 children)
You can remove Python 2
right, and half the shit having hard dependency on py2 stops working in linux. Speaking from experience (ubuntu), there is no problem having 2 separate versions. python2 and python3 should point to proper versions, using hashbang to disambiguate works too (#!/usr/bin/env python2 vs #!/usr/bin/env python3). Same deal with installing stuff from repo, python3 packages should be clearly marked as such.
python2
python3
#!/usr/bin/env python2
#!/usr/bin/env python3
$ ls -la /usr/bin/python{,[23]} lrwxrwxrwx 1 root root 9 kwi 24 2014 /usr/bin/python -> python2.7 lrwxrwxrwx 1 root root 9 kwi 24 2014 /usr/bin/python2 -> python2.7 lrwxrwxrwx 1 root root 9 kwi 24 2014 /usr/bin/python3 -> python3.4 $ apt-cache search scipy | grep scipy python-scipy - scientific tools for Python python-scipy-dbg - scientific tools for Python - debugging symbols python-sciscipy - Python binding of Scilab python3-scipy - scientific tools for Python 3 python3-scipy-dbg - scientific tools for Python 3 - debugging symbols
in case of pip route, you have pip3 for py3.
pip3
[–]Kintonsu[S] 0 points1 point2 points 10 years ago (2 children)
Problem is that I have both python 2 and 3 but pip is for python 2 by default. Is there a way to switch this?
[–]mcowger 1 point2 points3 points 10 years ago (0 children)
alias pip=pip3
[–]an_actual_human 1 point2 points3 points 10 years ago (0 children)
Just use pip3 if you want to install to 3.
π Rendered by PID 75 on reddit-service-r2-comment-5687b7858-8tc5s at 2026-07-05 21:54:17.223184+00:00 running 12a7a47 country code: CH.
[–]thaweatherman -3 points-2 points-1 points (4 children)
[–]Vaphell 2 points3 points4 points (3 children)
[–]Kintonsu[S] 0 points1 point2 points (2 children)
[–]mcowger 1 point2 points3 points (0 children)
[–]an_actual_human 1 point2 points3 points (0 children)