Category:Python: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 33: | Line 33: | ||
deactivate | deactivate | ||
</syntaxhighlight> | |||
= What Libs Have I? = | |||
<syntaxhighlight> | |||
$ pip freeze --local | |||
blinker==1.6.2 | |||
click==8.1.7 | |||
flask==2.3.3 | |||
importlib-metadata==6.8.0 | |||
itsdangerous==2.1.2 | |||
Jinja2==3.1.2 | |||
MarkupSafe==2.1.3 | |||
werkzeug==2.3.7 | |||
zipp==3.16.2 | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 01:25, 13 September 2023
buffering
Fix CLI buffering in Python with:
$ python -u foo.py | tee mylog.log
"-u" means unbuffered, or something
Virtual Environments
# Check Python version
python3 --version
# Check pip version
pip3 --version
# Install virtualenv
pip3 install virtualenv
# Navigate to your project directory
cd ~/my_project/
# Create virtual environment
python3 -m venv myenv
# Activate virtual environment
source myenv/bin/activate
# Now you can install packages
pip install <your-package>
# Deactivate when you're done
deactivate
What Libs Have I?
$ pip freeze --local
blinker==1.6.2
click==8.1.7
flask==2.3.3
importlib-metadata==6.8.0
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.3
werkzeug==2.3.7
zipp==3.16.2
Pages in category "Python"
The following 7 pages are in this category, out of 7 total.