I think the era is Python. I usually love JS (I love React), but I think Python will take the lead in machine learning and data processing. (I also want to write AWS Lambda in Python!)
I will study for the ideal of React on the front and AWS (Lambda is Python) on the back. (I just touched it a year ago and I don't remember.)
Also, I was wondering whether to use 2.X or 3.X, but I have been told by a respected person that both are necessary, so I hope I can re-introduce while comparing the differences.
3.x is now under development. Development of 2.x has stopped. However, the current Python frameworks can use 2.x, I am in a sad situation that 3.x cannot be used.
I thought it would be better to switch the Python version quickly, and when I investigated if there was any good way, it was normal.
There was a Python version called pyenv that could manage it. It's similar to nvm, which switches the version of Node.js.
It's super easy, just clone from GitHub.
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
After cloning, write the execute command to .bash_profile. It is OK if you add the following.
export PYENV_ROOT=$HOME/.pyenv
export PATH=$PYENV_ROOT/bin:$PATH
eval "$(pyenv init -)"
Now you are ready to switch versions of Python.
Install Python from pyenv. That said, it's easy and you can install it in one shot with the following command.
pyenv isntall 3.5.1
With the above command, you have installed the latest version of Python, 3.5.1. (Pip is installed as standard from 3.4.x, so it's OK as it is.)
There are three ways to specify pyenv.
pyenv global 3.5.1
pyenv local 3.5.1
pyenv shell 3.5.1
① is reflected in the entire system, and ② is reflected only in the current directory. Specify ③ with the shell you want to use temporarily.
I usually use 3.x, but this project can be separated smoothly into 2.x.
Also, even if you exit the terminal, this reflection will continue to live. It's extremely convenient.
If you want to return to the default Python on your Mac, the following is OK.
pyenv global system
Now you can switch versions at any time.
When you want some module,
pip install XXXX
Let's install and use it.
I'm just starting to review it, I think it's a waste to get stuck in different versions. Thoroughly manage Python version with pyenv so that version switching can be done smoothly from the beginning.
From Next time, we will start the grammar section.
Recommended Posts