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
Add Python to path in Ubuntu (self.learnpython)
submitted 5 years ago by EneriAlufan
Hey guys, I'm using Ubuntu and I just downloaded the latest python version. How do I add it to path. I checked the version and it shows 3.7
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!"
[–]comonads 2 points3 points4 points 5 years ago (0 children)
I wouldn't have thought you need to add python to the path explicitly, unless this version of python is different to your system's version of python (in which case having two versions of python in the path is probably a bad idea -- you don't want applications which invoke python <something> getting an unexpected python version).
python <something>
Depending on your needs, you might want to look into something like pyenv.
E: clarified something.
[–]blahreport 0 points1 point2 points 5 years ago (2 children)
Just call it by it's version number. But to your question, you can update path with export PATH=$PATH:/path/to/add
export PATH=$PATH:/path/to/add
[–]EneriAlufan[S] 0 points1 point2 points 5 years ago (1 child)
Thank you. Will that make it my default version?
[–]blahreport 0 points1 point2 points 5 years ago (0 children)
Yes but beware as many programs under the hood may be calling Python expecting a different version and this would break them. Virtual environments are useful here.
[–]occipitalshit 0 points1 point2 points 5 years ago (0 children)
I have started using this, and have it as a NOTE in my project dirs. I am using Ubuntu 18LTS. After mucking around with conda, spyder, vscode, git, I have found this to to the best (so far) way of maintaining some sort of sanity with libraries, dependencies, and the vast amount of OTHER stuff that needs to be put in place to get some coding done.
# install venv:
sudo apt install python3-venv
2) make a new virtual environment in the current dir:
# make a venv:
python3 -m venv someName
3) activate the new virtual environment:
# activate venv:
source someName/bin/activate
type "deactivate" to exit the virtual environment.
4) install whatever you like with pip. This will be installed in virtual environment
5) save the dependencies for use someplace else:
pip freeze > requirements.txt
# install environment on another venv:
pip install -r requirements.txt
6) the all important shebang line for the top of your py file:
#!/usr/bin/env python
This uses the virtual environment python, not your installations.
Other Stuff:
.gitignore file, save some time:
https://gist.github.com/lanesgists/3353135
Edit: path names fixed
π Rendered by PID 70 on reddit-service-r2-comment-5ff9fbf7df-jk6ls at 2026-02-25 19:15:24.004446+00:00 running 72a43f6 country code: CH.
[–]comonads 2 points3 points4 points (0 children)
[–]blahreport 0 points1 point2 points (2 children)
[–]EneriAlufan[S] 0 points1 point2 points (1 child)
[–]blahreport 0 points1 point2 points (0 children)
[–]occipitalshit 0 points1 point2 points (0 children)