0% acharam este documento útil (0 voto)
12 visualizações2 páginas

Tutorial pyenv-win: Configurando Python

Enviado por

douglas.boardman
Direitos autorais
© All Rights Reserved
Levamos muito a sério os direitos de conteúdo. Se você suspeita que este conteúdo é seu, reivindique-o aqui.
Formatos disponíveis
Baixe no formato PDF, TXT ou leia on-line no Scribd
0% acharam este documento útil (0 voto)
12 visualizações2 páginas

Tutorial pyenv-win: Configurando Python

Enviado por

douglas.boardman
Direitos autorais
© All Rights Reserved
Levamos muito a sério os direitos de conteúdo. Se você suspeita que este conteúdo é seu, reivindique-o aqui.
Formatos disponíveis
Baixe no formato PDF, TXT ou leia on-line no Scribd

Tutorial implementação ambiente

virtual com pyenv (windows)

Instalando o pyenv-win no PowerShell

Invoke-WebRequest -UseBasicParsing -Uri "[Link]

 

Comandos úteis
Uma vez realizada a instalação do pyenv-win, há alguns comandos úteis a
serem utilizados.

1. Execute pyenv --version para verificar se a instalação foi bem


sucedida.

2. Execute pyenv install -l para exibir a lista de versões do Python


suportadas pelo pyenv-win

3. Execute pyenv install <version> para instalar a versão suportada

4. Execute pyenv global <version> para definir a versão global do


Python no seu sistema

5. Verifique qual versão do Python você está usando e seu caminho

> pyenv version


<version> (set by \path\to\.pyenv\pyenv-win\.python-version)

6. Verifique se o Python está funcionando

> python -c "import sys; print([Link])"


\path\to\.pyenv\pyenv-win\versions\<version>\[Link]

Estabelecendo versão local do ambiente


pyenv local 3.13

Criando o ambiente virtual com python venv

pyenv exec python -m venv .venv

Ativando o ambiente virtual

.venv\Scripts\Activate.ps1

Comandos do pyenv-win

commands List all available pyenv commands


local Set or show the local application-specific Python vers
latest Print the latest installed or known version with the g
global Set or show the global Python version
shell Set or show the shell-specific Python version
install Install 1 or more versions of Python
uninstall Uninstall 1 or more versions of Python
update Update the cached version DB
rehash Rehash pyenv shims (run this after switching Python ve
vname Show the current Python version
version Show the current Python version and its origin
version-name Show the current Python version
versions List all Python versions available to pyenv
exec Runs an executable by first preparing PATH so that the
Python version's `bin' directory is at the front
which Display the full path to an executable
whence List all Python versions that contain the given execut

 

Você também pode gostar