[PYTHON] Homebrew and Pycharm installation instructions notes

I was interested in programming, so I prepared various things.

What i did

The following items were installed.

Premise

Homebrew, Python, library installation

https://qiita.com/yoshizaki_kkgk/items/4663148a2b3ca078ddbc Basically run according to the above article.

Homebrew and Python installation

"Let's check if Python is already installed", and while expecting no response, which python3, contrary to expectations, / usr / bin / python3 came back. It seems that python3 was installed before I knew it.

By the way, the version was Python 3.7.3.

Library installation

I hit pip3 install numpy to continue installing the library, but I get an error

The error message is Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/3.7' Consider using the --user option or check the permissions.

If you translate it freely, it feels like "The package could not be installed because of the permission denial of environment error [Error 13] /Library/Python/3.7. Consider using the --user option or check the permissions."

It seems that there is no authority

https://teratail.com/questions/10352 Looking at ↑, it is OK if you execute it with administrator privileges using sudo, so I did sudo pip3 install numpy and it was installed. However, he gets angry as follows. The Directory'/Users/XXX/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/Users/XXX/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

https://laboradian.com/error-with-pip-install/ And https://pyteyon.hatenablog.com/entry/2019/05/24/003924 Looking at, it seems better to use the --user option, so I installed it with sudo pip3 install --user scipy. This result didn't get angry, so it looks like the correct answer.

Similarly, I installed scikit-learn, Chainer, Jupyter notebook using --user.

Install Pycharm

I recommend Atom for the Kikagaku articles that I have referred to so far, but I wanted to use Pycharm that was taught on Twitter, so I changed the teacher from here. https://dev-reco.com/416 I installed Pycharm referring to this article.

Basically as written, but change only the location of Python used in step 8 (quoted below) of the link destination

Enter the following and press the "Create" button. Change the “untitled” part to your favorite project name. “Base interpreter” sets the Python used in the project. This time I want to use Python installed by pyenv, so change it to the following. ~/.pyenv/versions/3.7.1/bin/python3.7

This completes the installation of Pycharm. I found some interesting teaching materials on udemy, so I'm going to do it.

By the way, the reason why I don't use anaconda is the influence of this article. https://qiita.com/yniji/items/b1b20211846a5a9f189b

"vanilla" Whether to use Python or Anaconda is a matter of taste, as I wrote at the beginning. However, if you want to develop apps for web, desktop, embedded, games, mobile, etc., you should use "vanilla" Python. Since Anaconda is for data science, it lacks the packages needed to develop apps. It is possible to install them with pip, but installing a large number of packages with pip can lead to double management and problems. However, it's easy to move from "vanilla" Python to Anaconda and vice versa, and you can use it differently depending on your project, so you shouldn't worry too much about it.

Well, if you are in trouble, move to anaconda.

Recommended Posts

Homebrew and Pycharm installation instructions notes
Mecab installation notes
Theano installation notes
pyenv installation notes
Hydrogen installation notes
Python3.4 installation notes
Cabocha installation notes
Arch Linux installation notes
Notes on deploying pyenv with Homebrew and managing Python versions
Notes on tf.function and Tracing
Installation notes for TensorFlow for Windows
Notes on * args and ** kargs
Python installation and basic grammar
Notes on pyenv and Atom
Django installation and operation check
Scrapy installation troubles and solutions
Tomcat installation and autostart settings
Source installation and installation of Python
Python (Python 3.7.7) installation and basic grammar