Python Environments Explained: Virtualenv
Imagine that each Python project is like a snake’s egg: an isolated ecosystem, with everything it needs to grow. If the eggs shared the same liquid, one could contaminate the others. Virtual environments work the same way: each .venv
encapsulates the project’s dependencies, avoiding conflicts and ensuring everything runs independently.
Check Virtual Environment
which python
⚠️ If no path is shown, Python is probably not installed on the system.
If the result is something like /usr/bin/python
, it means the system’s default environment is being used.
On machines shared by multiple collaborators, check if the project has its own virtual environment and activate it to ensure local dependencies are used correctly. Look for files with something like .venv/bin/activate
:
ls -a | grep "bin/activate"
Create Virtual Environment
If the project is new or was cloned from a repository, it is necessary to create a virtual environment:
python3 -m venv .venv
Activate Environment
source .venv/bin/activate
Deactivate Environment
When you need to deactivate it, just run the following command:
deactivate
⚠️ In some cases, the environment prefix in the prompt or even the output of the which python
command may indicate the wrong virtual environment. A solution to this problem is simply to activate the desired environment again.
Conclusion
Just as a snake guards its clutch ensuring each egg is self-sufficient, virtual environments protect your projects from version conflicts and dependency errors. Explore more advanced tools like venv
(for lightweight environments) or virtualenv
/poetry
(for more complex needs), always keeping the philosophy of the "isolated nest".
Author: Thomas Cionek
Buen Sueño en el Bienestar del Ahora
A Good Dream in the Well-Being of Now
Sonho Bom no Bem-Estar do Agora
El Renacimiento del Pertenecer Natural – Joinville, los Umbu, los Sambaquíes y la Prosperidad Bribri
The Rebirth of Natural Belonging – Joinville, the Umbu People, the Sambaquis, and Bribri Prosperity
O Renascimento do Pertencimento Natural – Joinville, Umbus, Sambaquis e a Prosperidade Bribri
Movimiento de las Aguas Interiores y Sincronía Circadiana del Ser
Movement of the Inner Waters and Circadian Synchrony of Being
Movimento das Águas Interiores e Sincronia Circadiana do Ser
Cuerpo Territorio – La Conciencia del Espacio Vivido
Body Territory – The Consciousness of Lived Space
Corpo Território – A Consciência do Espaço Vivido
Movimiento de las Aguas – El ciclo vital dentro y fuera del ser
Movement of the Waters – The Vital Cycle Inside and Outside the Being
Movimento das Águas – O Ciclo Vital Dentro e Fora do Ser
Apus – La Propiocepción Extendida del Ser
Apus – The Extended Proprioception of Being
Apus – A Propriocepção Estendida do Ser
Yãy hã mĩy Extendido – El cuerpo que imitando se trasciende
Yãy hã mĩy Extended – The Body That Imitating, Transcends Itself
Yãy hã mĩy Extendido – O Corpo que Imitando se Transcende
Taá Extendido – El Sueño que Conecta Todas las Cosas
Extended Taá – The Dream that Connects All Things
Taá Estendido – O Sonho que Liga Todas as Coisas
Weicho - El Ser sin Diferencias
Weicho - Being Without Differences
Pei Utupe - El Alma como Información Comprometida
Pei Utupe - The Soul as Engaged Information
Pei Utupe - A Alma como Informação Engajada
Yãy hã mĩy - Imitarse Ser para Trascenderse Ser
Yãy hã mĩy - To Imitate Being to Transcend Being
Yãy hã mĩy - Imitar-se Ser para Transcender-se Ser
El Soñar de la Información - El Taá
The Dreaming of Information - The Taá
O Sonhar da Informação - O Taá
Sentir e Se Referenciar - Diferenças Fundamentais entre Parkinson e Alzheimer
Deputado Federal Joinville
#Neurociência
#Decolonial
#Fruição
#Metacognição
#Zona2
#EusTensionais
#Embodiment
#CorpoTerritório
#SonhoBom
#PeiUtupe
#BrainBee
#DREXCidadão
#ProsperidadeBribri
#Planeta01
#Sambaquis
#PovosOriginários
#JoinvilleArqueológica
#Umbu
#MataAtântica
#DREX
#CréditoCarbono
#PIX