About Python development environment

When I was trying to create a python environment when using TensorFlow, there was pyenv`` virtualenv pyenv-virtualenv and I was confused, so I summarized it.

pyenv You can specify the version to be used globally and the version to be used locally (for each directory) as shown below.

% cd python3.6.0
% pyenv local 3.6.0
% pyenv version
3.6.0 (set by /Users/hogehoge/work/python3.6.0/.python-version)
% cd ../
% pyenv version
2.7.13 (set by /Users/hogehoge/.pyenv/version)

virtualenv virtualenv allows you to create a virtual environment Available by source django / bin / activate The following is, for example, when creating a virtual environment for django


% mkdir virtualenv-sandbox
% cd virtualenv-sandbox
% virtualenv django
% source django/bin/activate
(django) [hoge@moge-no-MacBook-Air] ~/work/virtualenv-sandbox
% pip list
appdirs (1.4.3)
packaging (16.8)
pip (9.0.1)
pyparsing (2.2.0)
setuptools (34.3.3)
six (1.10.0)
wheel (0.29.0)
% pip install django
Collecting django
  Downloading Django-1.10.6-py2.py3-none-any.whl (6.8MB)
    100% |████████████████████████████████| 6.8MB 175kB/s
Installing collected packages: django
Successfully installed django-1.10.6
% pip list
appdirs (1.4.3)
Django (1.10.6)
packaging (16.8)
pip (9.0.1)
pyparsing (2.2.0)
setuptools (34.3.3)
six (1.10.0)
wheel (0.29.0)

You can get out of the development environment by deactivating. After deactivating, I did pip list and confirmed that Django wasn't there.

% deactivate
% pip list
pip (9.0.1)
setuptools (28.8.0)
virtualenv (15.1.0)

pyenv-virtualenv You can create a virtual environment with a mechanism different from the above virtualenv Extension of pyenv It will be available with pyenv activate

I will write it again

Summary

Looking at the installation of TensorFlow, it uses virtualenv, so I will use this. https://www.tensorflow.org/install/install_mac

reference

http://dackdive.hateblo.jp/entry/2015/12/12/163400 http://qiita.com/bohemian916/items/4f0736dcea932a162d9e

Recommended Posts

About Python development environment
python2.7 development environment construction
Development environment in Python
Organize your Python development environment
[ev3dev × Python] Build ev3dev development environment
[MEMO] [Development environment construction] Python
[For organizing] Python development environment
python memo (for myself): About the development environment virtualenv
[Python] Chapter 01-02 About Python (Execution and installation of development environment)
Prepare Python development environment on Ubuntu
[Python3] Development environment construction << Windows edition >>
Python development environment options for May 2020
Vim + Python development environment setting memo
Emacs settings for Python development environment
Install Python development environment on Windows 10
Emacs Python development environment construction memo
Checking the NAOqi Python development environment
Prepare Python development environment with Atom
About python slices
About python comprehension
Python environment construction
About Python tqdm.
python environment settings
About python yield
About python, class
python windows environment
Environment construction (python)
About python inheritance
About python, range ()
python environment construction
Python --Environment construction
About python decorators
Python environment construction
About python reference
About Python decorators
[Python] About multi-process
python environment construction
Python development environment for macOS using venv 2016
[Development environment] Python with Xcode [With screen transition]
Blender 2.82 or later + python development environment notes
How to prepare Python development environment [Mac]
Python3 + venv + VSCode + macOS development environment construction
About the development environment you are using
Build Python development environment (pythonz, virtualenv, direnv)
The strongest Python development environment PyCharm's recommendation
Building a Python development environment for AI development
Windows + gVim + Poetry python development environment construction
Find out about Cinema 4D's Python environment
The strongest Python integrated development environment PyCharm
About Python for loops
Summary about Python scraping
[Python] Get environment variables
About function arguments (python)
My python environment memo
Introduction to Python Let's prepare the development environment
Unification of Python environment
python windows environment construction
Build Python development environment with Visual Studio Code
homebrew python environment construction
[Python] Memo about functions
Summary about Python3 + OpenCV3