[PYTHON] Try using virtualenv now

I looked at pypy, but if you think about it, you can change python just by changing environment variables. I thought about it now, so I installed it

Appropriate in order or proportion. As a prerequisite, XCode, HomeBrew and pip are already installed.

First pypy installation

$ pip install pypy

Then install virtualenv

$ sudo pip install virtualenv
Password:
Downloading/unpacking virtualenv
  Downloading virtualenv-1.9.1.tar.gz (2.0MB): 2.0MB downloaded
  Running setup.py egg_info for package virtualenv

    warning: no previously-included files matching '*' found under directory 'docs/_templates'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
Installing collected packages: virtualenv
  Running setup.py install for virtualenv

    warning: no previously-included files matching '*' found under directory 'docs/_templates'
    warning: no previously-included files matching '*' found under directory 'docs/_build'
    Installing virtualenv script to /usr/local/bin
    Installing virtualenv-2.7 script to /usr/local/bin
Successfully installed virtualenv
Cleaning up...

After that, collect the existing Python and set the environment

$ virtualenv -p `which pypy` pypy
Running virtualenv with interpreter /usr/local/bin/pypy
New pypy executable in pypy/bin/pypy
Installing setuptools............done.
Installing pip...............done.

$ virtualenv -p `which python` python_2_7_1
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in python_2_7_1/bin/python
Installing setuptools............done.
Installing pip...............done.

$ virtualenv -p `which python2.6` python_2_6_7
Running virtualenv with interpreter /usr/bin/python2.6
New python executable in python_2_6_7/bin/python2.6
Also creating executable in python_2_6_7/bin/python
Installing setuptools............................done.
Installing pip...............done.

So, change the python to be executed at the end.

[yasui@yasui-MBA: ~][13:23] $ source ~/pypy/bin/activate
(pypy)[yasui@yasui-MBA: ~][13:23] $ python -V
Python 2.7.2 (341e1e3821ff, Jun 07 2012, 15:42:54)
[PyPy 1.9.0 with GCC 4.2.1]
(pypy)[yasui@yasui-MBA: ~][13:24] $

(pypy)[yasui@yasui-MBA: ~][13:24] $ source ~/python_2_7_1/bin/activate
(python_2_7_1)[yasui@yasui-MBA: ~][13:24] $ python -V
Python 2.7.1
(python_2_7_1)[yasui@yasui-MBA: ~][13:24] $

(python_2_7_1)[yasui@yasui-MBA: ~][13:24] $ source ~/python_2_6_7/bin/activate
(python_2_6_7)[yasui@yasui-MBA: ~][13:26] $ python -V
Python 2.6.7
(python_2_6_7)[yasui@yasui-MBA: ~][13:26] $

Recommended Posts

Try using virtualenv now
Try using virtualenv (virtualenvwrapper)
Try using Tkinter
Try using docker-py
Try using cookiecutter
Try using PDFMiner
Try using geopandas
Try using Selenium
Try using scipy
Try using pandas.DataFrame
Try using django-swiftbrowser
Try using matplotlib
Try using tf.metrics
Try using PyODE
[Azure] Try using Azure Functions
Try using W & B
Try using Django templates.html
[Kaggle] Try using LGBM
Try using Python's feedparser.
Try using Python's Tkinter
Try using Tweepy [Python2.7]
Try using Pytorch's collate_fn
Try using PythonTex with Texpad.
Try using Jupyter's Docker image
Try using scikit-learn (1) --K-means clustering
Try function optimization using Hyperopt
Try using matplotlib with PyCharm
Try using Kubernetes Client -Python-
[Kaggle] Try using xg boost
Try using the Twitter API
Try using OpenCV on Windows
Try using Jupyter Notebook dynamically
Try using AWS SageMaker Studio
Try tweeting automatically using Selenium.
Try using SQLAlchemy + MySQL (Part 1)
Try using the Twitter API
Try using SQLAlchemy + MySQL (Part 2)
Try using Django's template feature
Try using the PeeringDB 2.0 API
Try using Pelican's draft feature
Try using pytest-Overview and Samples-
Try using folium with anaconda
[Statistics] [R] Try using quantile regression.
Try using design patterns (exporter edition)
Try using Pillow on iPython (Part 1)
Try using Pillow on iPython (Part 2)
Try using virtualenv, which can build a virtual environment for Python
Try using Pleasant's API (python / FastAPI)
Try using LevelDB in Python (plyvel)
Try using pynag to configure Nagios
Try using PyCharm's remote debugging feature
Try using ArUco on Raspberry Pi
Try using cheap LiDAR (Camsense X1)
[Sakura rental server] Try using flask.
Try using Pillow on iPython (Part 3)
Reinforcement learning 8 Try using Chainer UI
Try to get statistics using e-Stat
Try using Python argparse's action API
Try using the Python Cmd module
Try using Python's networkx with AtCoder
Try using Leap Motion in Python