Using pyenv to install Python and create a virtual environment

Posted on Sat 10 October 2020 in Development • Tagged with python, development, pyenv, virtualenv, mkvirtualenv, environment, python39, programming, pip, macos, install, version

How to use pyenv to install a specific version of Python and create a virtual environment with that version


Continue reading

Installing Python and virtualenv on MacOS

Posted on Wed 19 December 2018 in Python • Tagged with python, osx, programming, software, development, macos, virtualenv, venv, version, installing, installation, brew, mkvirtualenv, virtualenvwrapper

How to install Python and virtualenv on MacOS


Continue reading

Using virtualenv to manage multiple Python/Django environments in the same machine

Posted on Thu 25 April 2013 in HowTo, Linux, Programmazione, Python, Ubuntu (EN) • Tagged with Django, Python, virtualenv

Developing Python applications sometimes it's useful to be able to test the code with different environments, for example a particular version of Python or a specific Django version etc... Setting up many different virtual machines would be really too much work and even using a chroot environment is not what you need in some cases. Thanks to virtualenv is it possible to create a self contained Python environment with all the specific libraries you may need. Using virtualenv is very easy:

  • Creating the virtual environment: virtualenvmyenv¬†--no-site-packages
  • Entering the virtual environment: source myenv/bin/activate
  • Deactivating the virtual environment: deactivate

That's it! Once you're inside the virtual environment you will be using the Python libraries inside it. I suggest you to install all the Python libraries you need using pip.