First off (excuse w), this article is my reminder that I have never touched Python. I think that there are many "mistakes" and "misunderstandings" in the description, so please kindly point out.
When creating a simple app, I used to create it with Ruby on Rails.
I'm a Framework enthusiast, even though I haven't mastered Ruby, so I'll try to flirt with the Web Framework of Python for some reason.
I've been interested in Python since about last year, but at that time it seems that Frameworks such as Django didn't support Python3, so I gave up learning emotionally. However, the recent Framework is now compatible with Python3, so I decided to restart it.
If you want to start anew, the combination of Python3 and Framework between the new versions is more efficient, and I think it will be less troublesome due to the consistency of various versions.
PC: MacOS X 10.9.4 Python3.4.1
Check the version of Python installed.
Start the terminal and type python --version as shown below.
Apparently, Python 2.7.5 is installed by default in my PC environment.

So, go to the Python download site and download it. As of the end of August 2014, the latest seems to be Python 3.4.1. Then press the download button to download and you can download python-3.4.1-macosx10.6.dmg.

Click the downloaded dmg file to decompress it.
Click on Python.mpkg in the unzipped file.

However, in my environment I got an installation warning.

From here, it's a bit of a detour, but open "Security & Privacy" from "System Preferences".

As shown below, there is a message "" Python.mpkg "could not be opened because the developer cannot be confirmed.", So click the "Open as is" button.

By the way, if the "Allow applications from Mac App Store and confirmed developers" selection is grayed out, you can change it by clicking the key at the bottom left, asking for your password.

Once the installer launches successfully, continue with your consent.




Check the version of Python from the terminal again. However, for some reason, the version of Python that can start commands does not change.
Actually, I was a little addicted to it, but it seems that the Python3 command is started with python3.

By the way, the substance of the python3 command when installed by the above method seems to be the following path.
/Library/Frameworks/Python.framework/Versions/3.4/bin/Python3.4

In general, it's unclear whether it's better to break the alias for the python command or change the path.
I don't know very well, but tools such as pip, ʻeasy-install, and pyvenv(such asgem in Ruby?) Are also located in the same directory and can be passed through the path. Seems to be. However, when executing the command, it seems necessary to add version (3) like pip3`. This area may get confused later.

For the time being, the article has become long, so this time I will stop here.
Recommended Posts