Python and Python Environments
Savršeno objašnjenje: python - What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc? - Stack Overflow
Ukratko, venv je novi oficijelni
Zvanično uputustvo: Installing packages using pip and virtual environments — Python Packaging User Guide, odnosno
python3 i pip3 već imamo, ali se odmah žali da pip treba updateovati
python3 -m venv env
neću da koristim brew - bolje sa brew jer ce staviti najnoviju verziju 3.11
brew install python
Menjam sve, idem na “asdf” a evo objašnjeno i zašto. Homebrew Python Is Not For You // Justin Mayer // Investor • Founder • Developer • Speaker
asdf supports several popular programming languages, including Node.js, Ruby, Python, Elixir, Java, Rust, PHP, Perl, Haskell, R, Lua, and Earlang.
install it
brew install asdf
add to your bashrc/zshrc
echo -e “\n. $(brew –prefix asdf)/libexec/asdf.sh” » ${ZDOTDIR:-~}/.zshrc
reload zsh
. ~/.zshrc
now install lates python
asdf plugin-add python
mora i ovo odmah ovom redosledu
asdf install python latest asdf global python latest
nadalje možeš da kucaš samo python / pip
python –version
and use venv + pip as normal
package venv is a built-in package
mkdir -p ~/dev cd ~/dev mkdir example
napravi svoj neki env
python -m venv env
activate
source env/bin/activate
update pip in that environment
python -m pip install pip –upgrade
deactivate
deactivate
A