How to build an environment when you want to use python2.7 after installing Anaconda3

No need to use virtualenv $ conda create -n py27 python=2.7 anaconda If so, {Anaconda3 path} / env / py27 will be created.

If you want to use python2.7, use the following command.

in windows $ activate py27

To return to python3, use the following command. $ deactivate

That's very easy. Anaconda is wonderful.

[Addition] On mac When using python2.7 (for anaconda3-2.5.0) $ source ~/.pyenv/versions/anaconda3-2.5.0/bin/activate py27 When reverting to python3 $ source ~/.pyenv/versions/anaconda3-2.5.0/bin/deactivate

Since the above is long, it is convenient to add the following to ~ / .bashrc etc. alias py2='source ~/.pyenv/versions/anaconda3-2.5.0/bin/activate py27' alias py3='source ~/.pyenv/versions/anaconda3-2.5.0/bin/deactivate'

Then $ py2 Or $ py3 You can switch the python version with.

Reference URL

Recommended Posts

How to build an environment when you want to use python2.7 after installing Anaconda3
Solution when you want to use cv_bridge with python3 (virtualenv)
I want to build a Python environment
[Python] When you want to use all variables in another file
How to add python module to anaconda environment
When you want to use multiple versions of the same Python library (virtual environment using venv)
After buying a new Mac, use pyenv + poetry to build a Python environment.
Python Note: When you want to know the attributes of an object
Notes from installing Homebrew to building an Anaconda environment for Python with pyenv
How to write environment variables that you don't want to put on [GitHub] Python
How to build an environment for using multiple versions of Python on Mac
What to do if you get an error when installing python with pyenv
How to build a Django (python) environment on docker
How to build a Python environment on amazon linux 2
python3: How to use bottle (2)
What to do if you get an OpenSSL error when installing Python 2 with pyenv
[Python] How to use list 1
Build an Anaconda virtual environment
A story about how Windows 10 users created an environment to use OpenCV3 with Python 3.5
How to use Python argparse
Python: How to use pydub
[Python] How to use checkio
You don't need to install Anaconda to build a machine learning environment. Let's use Miniconda
[Python] How to use input ()
How to use Python lambda
[Python] How to use virtualenv
python3: How to use bottle (3)
python3: How to use bottle
How to use Python bytes
A convenient function memo to use when you want to enter the debugger if an error occurs when running a Python script.
[Python] If you suddenly want to create an inquiry form
How to build a new python virtual environment on Ubuntu
Use aggdraw when you want to draw beautifully with pillow
How to run an app built with Python + py2app built with Anaconda
How to build a python2.7 series development environment with Vagrant
When you want to use python2.x on modern Gentoo Linux
When you want to hit a UNIX command on Python
I know? Data analysis using Python or things you want to use when you want with numpy
[Python] When you want to import and use your own package in the upper directory
If you want to use field names with hyphens when updating firestore data in python
[Sakura Rental Server] (For beginners) How to build an environment for Python, pyenv, and Flask. | For csh
How to install python using anaconda
Python: How to use async with
[Python] How to use Pandas Series
How to use Requests (Python Library)
How to use SQLite in Python
[Python] How to use list 3 Added
How to use Mysql in python
How to use OpenPose's Python API
How to use ChemSpider in Python
How to use FTP with Python
Python: How to use pydub (playback)
How to use PubChem in Python
How to use python zip function
[Python] How to use Typetalk API
[Subprocess] When you want to execute another Python program in Python code
How to use Serverless Framework & Python environment variables and manage stages
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
[Python] Explains how to use the format function with an example
How to deal with errors when installing Python and pip with choco
How to use an external editor for Python development with Grasshopper