$ python --version
Python 2.7.10
$ which python
/usr/bin/python
Wenn Sie es mit Homebrew installieren, ist es praktisch, da es python3.x symbolisch mit dem Befehl python3
oder dem später beschriebenen Befehl pip
zu verknüpfen scheint.
--XCode ist bereits installiert --homebrew ist bereits installiert
$ brew search python
app-engine-python [email protected] micropython python-markdown wxpython
boost-python gst-python python python3 zpython
caskroom/cask/kk7ds-python-runtime caskroom/cask/mysql-connector-python
brew install python3
~/.bash_profile
export PATH=/usr/local/bin:$PATH
$ source ~/.bash_profile
$ python -V
Python 2.7.10
$ python3 -V
Python 3.6.1
Python-Paketmanager. Es wird mit Ihnen geliefert, wenn Sie python3 installieren.
$ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.1)
setuptools (32.2.0)
wheel (0.29.0)
Geben Sie "pip.conf" ein, geben Sie das Format an, und es wurde gewarnt, damit es entspricht. Der Mac scheint sich in "$ HOME / Library / Application Support / pip / pip.conf" zu befinden, aber ich hatte ihn nicht, also habe ich ihn erstellt.
$ cd /Users/kumanoshuta/Library/"Application Support"
$ mkdir pip
$ cd pip
$ vi pip.conf
[list]
format=columns
$ pip3 list
Package Version
---------- -------
pip 9.0.1
setuptools 32.2.0
wheel 0.29.0
Es bietet eine virtuelle Umgebung zum Wechseln der Version von Python selbst und der verwendeten Pakete.
Ich frage mich, ob ein Versionswechsel erforderlich ist oder ob Docker oder Vergrant in Ordnung sind, also werde ich es weglassen.
$ pip3 install django
Collecting django
Downloading Django-1.11.2-py2.py3-none-any.whl (6.9MB)
100% |████████████████████████████████| 7.0MB 207kB/s
Collecting pytz (from django)
Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)
100% |████████████████████████████████| 491kB 1.7MB/s
Installing collected packages: pytz, django
Successfully installed django-1.11.2 pytz-2017.2
$ pip3 list
Package Version
---------- -------
Django 1.11.2
pip 9.0.1
pytz 2017.2
setuptools 32.2.0
wheel 0.29.0
$ django-admin startproject mysite
$ python3 manage.py runserver 0.0.0.0:8000
Performing system checks...
System check identified no issues (0 silenced).
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
June 13, 2017 - 04:16:41
Django version 1.11.2, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Ich habe einen Fehler erhalten, konnte ihn aber starten.
Führen Sie als Nächstes [DB-Einstellungen] aus (http://qiita.com/shoota_github/items/e6e4e7934aa844917f2d).
Recommended Posts