Try using virtualenv, which can build a virtual environment for Python

virtualenv is a package that allows you to create a virtual environment for Python. You will be able to change the Python version for each project, and install and run the required packages separately.

Installation

Install virtualenv

$ sudo easy_install virtualenv
・ ・ ・
Installed /Library/Python/2.7/site-packages/virtualenv-1.11.6-py2.7.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
$

Success if such a log appears.

How to use

Create virtual environment

Create a project directory.

$ mkdir PythonTest

Execute virtualenv command

$ virtualenv --no-site-packages PythonTest
New python executable in PythonTest/bin/python
Installing setuptools, pip...done.
$

If successful, you will see a log like this. This will create a virtual environment.

Start virtual environment

You can use the virtual environment by executing the source command for bin / activate in the created directory.

$ cd PythonTest
$ source bin/activate
(PythonTest)%

If the virtual environment can be started, the console ** (directory name)% ** as shown above will be started. Use this console to install the required packages.

Virtual environment exit

(PythonTest)% deactivate                                                         
%

You can deactivate the virtual environment by typing ** deactivate **.

Package installation

(PythonTest)%pip install package

Recommended Posts

Try using virtualenv, which can build a virtual environment for Python
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a Python virtual environment using venv (Django + MySQL ①)
Build a python virtual environment with virtualenv and virtualenvwrapper
Let's create a virtual environment for Python
[Mac] Building a virtual environment for Python
Build a python virtual environment with pyenv
Build a local development environment for Lambda + Python using Serverless Framework
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Build a simple Python virtual environment without pyenv
Commands for creating a python3 environment with virtualenv
Work in a virtual environment with Python virtualenv.
Try using tensorflow ① Build python environment and introduce tensorflow
Build a Python virtual environment that anyone can understand September 2016 (pyenv + virutalenv)
Build a python environment for each directory with pyenv-virtualenv
Building a Python virtual environment
Build a Python environment on your Mac using pyenv
Build a Python development environment using pyenv on MacOS
Build a Python environment offline
Building a Python virtual environment
Memo for building a machine learning environment using Python
Build a Django environment for Win10 (with virtual space)
Build an environment for machine learning using Python on MacOSX
How to build a new python virtual environment on Ubuntu
Enable the virtualenv Python virtual environment for Visual Studio Code
Try a similar search for Image Search using the Python SDK [Search]
[Python] Building a virtual python environment for the pyramid tutorial (summary)
Create a virtual environment for python on mac [Very easy]
Build a python environment on CentOS 7.7 for your home server
Build a go environment using Docker
Create a virtual environment with Python!
Building a virtual environment with Python 3
Build a python3 environment on CentOS7
Build and test a CI environment for multiple versions of Python
Build and try an OpenCV & Python environment in minutes using Docker
Build a Python execution environment using GPU with GCP Compute engine
Build an environment for Blender built-in Python
Python development environment for macOS using venv 2016
Build a python environment on MacOS (Catallina)
[Python] Create a virtual environment with Anaconda
pyenv-Building a pypy environment using virtualenv (MacOSX)
[Python] Create a Batch environment using AWS-CDK
I want to build a Python environment
Creating a python virtual environment on Windows
Build Python development environment (pythonz, virtualenv, direnv)
Build a Python + OpenCV environment on Cloud9
Build a modern Python environment with Neovim
Building a Python development environment for AI development
Add a Python virtual environment to VSCode
Building a virtual environment for Mayavi dedicated to Python 3.6, Anaconda, Spyder users
Build a version control environment for Python, Ruby, Perl, Node.js on UNIX
Try using APSW, a Python library that SQLite can get serious about
[Mac] Build a Python 3.x environment at the fastest speed using Docker
Try to set up a Vim test environment quite seriously (for Python)
Quickly build a python environment for deep learning and data science (Windows)
Build Python + django + nginx + MySQL environment using docekr
How to create a Python virtual environment (venv)
Ubuntu18.04.05 Creating a python virtual environment in LTS
Build Python3.5 + matplotlib environment on Ubuntu 12 using Anaconda
Building a python environment with virtualenv and direnv
Simply build a Python 3 execution environment on Windows