Python and Django: Difference between revisions

From HaFrWiki42
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 16: Line 16:


== Python 2 installation ==
== Python 2 installation ==
Python 2 is part of the software stack of the MAMP-installation.
The symbolic links in the Application MAMP bin directory (/Applications/MAMP/Library/bin):
The symbolic links in the Application MAMP bin directory (/Applications/MAMP/Library/bin):
<syntaxhighlight lang="bash" line start="1">
<syntaxhighlight lang="bash" line start="1">
Line 26: Line 28:
-rwxrwxr-x  1 frielink1  admin  1.7K Jul  6  2015 python2.7-config
-rwxrwxr-x  1 frielink1  admin  1.7K Jul  6  2015 python2.7-config
</syntaxhighlight>
</syntaxhighlight>
* The '''1st'' and '''3rd''' symbolic link make the {{FormFCTW|8|blue|bold|python}} command point to {{FormFCTW|8|blue|bold|python2.7}} on the '''5th''' line.
* The '''2st'' and '''4rd''' symbolic link make the {{FormFCTW|8|blue|bold|python}} command point to {{FormFCTW|8|blue|bold|python2.7}} on the '''6th''' line.
* The '''2nd''' and '''4th''' symbolic link make the {{FormFCTW|8|blue|bold|python-config}} command point to the {{FormFCTW|8|blue|bold|python2.7-config}} on the '''6th''' line.
* The '''3nd''' and '''5th''' symbolic link make the {{FormFCTW|8|blue|bold|python-config}} command point to the {{FormFCTW|8|blue|bold|python2.7-config}} on the '''7th''' line.
 
== python 3.7 installation ==
This version has been installed by the Mac user. It has the following symbolic links (/usr/local/bin):
<syntaxhighlight lang="bash" line start="1">
$ la python*
lrwxr-xr-x  1 root      wheel    69B Dec 23 19:11 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3
lrwxr-xr-x  1 root      wheel    72B Dec 23 19:11 python3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-32
lrwxr-xr-x  1 root      wheel    76B Dec 23 19:11 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config
lrwxr-xr-x  1 root      wheel    71B Dec 23 19:11 python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
lrwxr-xr-x  1 root      wheel    74B Dec 23 19:11 python3.6-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-32
lrwxr-xr-x  1 root      wheel    78B Dec 23 19:11 python3.6-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config
lrwxr-xr-x  1 root      wheel    72B Dec 23 19:11 python3.6m -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m
lrwxr-xr-x  1 root      wheel    79B Dec 23 19:11 python3.6m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
</syntaxhighlight>
There are 3 different Python version of 3.6 installed:
* Python 3
* Python 3.6
* Python 3,6m
 
== Migrate 2.7 to 3.6 ==
First remove the python and python-config from the MAMP bin (/Applications/MAMP/Library/bin):
<syntaxhighlight lang="bash" line start="1">
$ pwd
/Applications/MAMP/Library/bin
 
$ mv python python_
$ mw python-config python-config_
</syntaxhighlight>
 
<syntaxhighlight lang="bash" line start="1">
$ pwd
/usr/local/bin
 
$ ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 python
lrwxr-xr-x  1 frielink1  admin    63B Dec 23 19:52 python -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
 
$ ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config python-config
 
# Resulting in:
la python*
lrwxr-xr-x  1 frielink1  admin    63B Dec 23 19:52 python -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
lrwxr-xr-x  1 frielink1  admin    70B Dec 24 10:41 python-config -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config
lrwxr-xr-x  1 root      wheel    69B Dec 23 19:11 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3
lrwxr-xr-x  1 root      wheel    72B Dec 23 19:11 python3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-32
lrwxr-xr-x  1 root      wheel    76B Dec 23 19:11 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config
lrwxr-xr-x  1 root      wheel    71B Mar  8  2016 python3.5 -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
lrwxr-xr-x  1 root      wheel    74B Mar  8  2016 python3.5-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-32
lrwxr-xr-x  1 root      wheel    78B Mar  8  2016 python3.5-config -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config
lrwxr-xr-x  1 root      wheel    72B Mar  8  2016 python3.5m -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m
lrwxr-xr-x  1 root      wheel    79B Mar  8  2016 python3.5m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config
lrwxr-xr-x  1 root      wheel    71B Dec 23 19:11 python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
lrwxr-xr-x  1 root      wheel    74B Dec 23 19:11 python3.6-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-32
lrwxr-xr-x  1 root      wheel    78B Dec 23 19:11 python3.6-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config
lrwxr-xr-x  1 root      wheel    72B Dec 23 19:11 python3.6m -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m
lrwxr-xr-x  1 root      wheel    79B Dec 23 19:11 python3.6m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config
</syntaxhighlight>


== See also ==
== See also ==

Revision as of 11:42, 24 December 2017

Introduction

Mac OSX

Standard Python version 2.7.10 is installed on Mac OSX High Sierra and under MAMP. This version is located in:

  • /Application/MAMP/Library/bin/python
  • /usr/bin/python

Official this version is deprecated and is out-of-service from 2020. A good reason to upgrade [1]. The installer will create a directory:

  • /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6
  • /usr/local/bin/python3.6

Python 2 installation

Python 2 is part of the software stack of the MAMP-installation.

The symbolic links in the Application MAMP bin directory (/Applications/MAMP/Library/bin): <syntaxhighlight lang="bash" line start="1"> $ la python* lrwxr-xr-x 1 frielink1 admin 7B Dec 23 20:01 python -> python2 lrwxr-xr-x 1 frielink1 admin 14B Mar 8 2016 python-config -> python2-config lrwxr-xr-x 1 frielink1 admin 9B Mar 8 2016 python2 -> python2.7 lrwxr-xr-x 1 frielink1 admin 16B Mar 8 2016 python2-config -> python2.7-config -rwxrwxr-x 1 frielink1 admin 2.0M Jul 6 2015 python2.7 -rwxrwxr-x 1 frielink1 admin 1.7K Jul 6 2015 python2.7-config </syntaxhighlight>

  • The 2st and 4rd' symbolic link make the python command point to python2.7 on the 6th line.
  • The 3nd and 5th symbolic link make the python-config command point to the python2.7-config on the 7th line.

python 3.7 installation

This version has been installed by the Mac user. It has the following symbolic links (/usr/local/bin): <syntaxhighlight lang="bash" line start="1"> $ la python* lrwxr-xr-x 1 root wheel 69B Dec 23 19:11 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3 lrwxr-xr-x 1 root wheel 72B Dec 23 19:11 python3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-32 lrwxr-xr-x 1 root wheel 76B Dec 23 19:11 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config lrwxr-xr-x 1 root wheel 71B Dec 23 19:11 python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 lrwxr-xr-x 1 root wheel 74B Dec 23 19:11 python3.6-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-32 lrwxr-xr-x 1 root wheel 78B Dec 23 19:11 python3.6-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config lrwxr-xr-x 1 root wheel 72B Dec 23 19:11 python3.6m -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m lrwxr-xr-x 1 root wheel 79B Dec 23 19:11 python3.6m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config </syntaxhighlight> There are 3 different Python version of 3.6 installed:

  • Python 3
  • Python 3.6
  • Python 3,6m

Migrate 2.7 to 3.6

First remove the python and python-config from the MAMP bin (/Applications/MAMP/Library/bin): <syntaxhighlight lang="bash" line start="1"> $ pwd /Applications/MAMP/Library/bin

$ mv python python_ $ mw python-config python-config_ </syntaxhighlight>

<syntaxhighlight lang="bash" line start="1"> $ pwd /usr/local/bin

$ ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 python lrwxr-xr-x 1 frielink1 admin 63B Dec 23 19:52 python -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6

$ ln -s /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config python-config

  1. Resulting in:

la python* lrwxr-xr-x 1 frielink1 admin 63B Dec 23 19:52 python -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 lrwxr-xr-x 1 frielink1 admin 70B Dec 24 10:41 python-config -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config lrwxr-xr-x 1 root wheel 69B Dec 23 19:11 python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3 lrwxr-xr-x 1 root wheel 72B Dec 23 19:11 python3-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-32 lrwxr-xr-x 1 root wheel 76B Dec 23 19:11 python3-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3-config lrwxr-xr-x 1 root wheel 71B Mar 8 2016 python3.5 -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 lrwxr-xr-x 1 root wheel 74B Mar 8 2016 python3.5-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-32 lrwxr-xr-x 1 root wheel 78B Mar 8 2016 python3.5-config -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5-config lrwxr-xr-x 1 root wheel 72B Mar 8 2016 python3.5m -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m lrwxr-xr-x 1 root wheel 79B Mar 8 2016 python3.5m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5m-config lrwxr-xr-x 1 root wheel 71B Dec 23 19:11 python3.6 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 lrwxr-xr-x 1 root wheel 74B Dec 23 19:11 python3.6-32 -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-32 lrwxr-xr-x 1 root wheel 78B Dec 23 19:11 python3.6-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6-config lrwxr-xr-x 1 root wheel 72B Dec 23 19:11 python3.6m -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m lrwxr-xr-x 1 root wheel 79B Dec 23 19:11 python3.6m-config -> ../../../Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6m-config </syntaxhighlight>

See also

top

Reference

top

  1. Upgrade Python on Mac to version3., Download page for the installer of Python 3.6 on Apple Mac OSX.