# virtualenvpython
的環境是前兩天安裝好的,安裝指令以下:mysql
1594 tar xvfz virtualenv-15.0.1.tar.gz 1595 ll 1596 cd virtualenv-15.0.1/ 1597 ll 1598 python setup.py install 1599 sudo python setup.py install
這個也是前兩天裝好的,記不清具體過程了,翻了一下history看了一下,找到一條,不記得是否是了。linux
sudo pip install virtualenvwrapper
# mysqlsql
這個很順利,直截就裝好了。數據庫
sudo apt-get install mysql-server
# djangodjango
pip install django (py273) janl@janl-studio:~/code/python$ pip list Django (1.9.5) pip (8.1.1) setuptools (20.7.0) wheel (0.29.0)
pip install django-bootstrap3 (py273) janl@janl-studio:~/code/python$ pip list Django (1.9.5) django-bootstrap3 (7.0.1) pip (8.1.1) setuptools (20.7.0) wheel (0.29.0)
pip install djangorestframework pip install markdown pip install django-filter (py273) janl@janl-studio:~/code/python/django_code/mysite$ pip list Django (1.9.5) django-bootstrap3 (7.0.1) django-filter (0.13.0) djangorestframework (3.3.3) Markdown (2.6.6) pip (8.1.1) setuptools (20.7.0) wheel (0.29.0)
#MySQLdbbootstrap
python manage.py migrate django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb pip install MySQL-python sh: 1: mysql_config: not found Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-N54ETK/MySQL-python/setup.py", line 17, in <module> metadata, options = get_config() File "/tmp/pip-build-N54ETK/MySQL-python/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/tmp/pip-build-N54ETK/MySQL-python/setup_posix.py", line 25, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,)) EnvironmentError: mysql_config not found sudo apt-get install libmysqlclient-dev gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/include/mysql -I/usr/include/python2.7 -c _mysql.c -o build/temp.linux-i686-2.7/_mysql.o -DBIG_JOINS=1 -fno-strict-aliasing -g _mysql.c:29:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1 sudo apt-get install python-dev pip install mysql-python
而後就OK了,能夠連上mysql數據庫了。markdown
(py273) janl@janl-studio:~/code/python/django_code/mysite$ python manage.py runserver Performing system checks... System check identified no issues (0 silenced). April 19, 2016 - 11:27:45 Django version 1.9.5, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C. Not Found: / [19/Apr/2016 11:28:08] "GET / HTTP/1.1" 200 1767 Not Found: /favicon.ico [19/Apr/2016 11:28:08] "GET /favicon.ico HTTP/1.1" 404 1936