# virtualenv
的环境是前两天安装好的,安装指令如下:
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
virtualenvwrapper
这个也是前两天装好的,记不清具体过程了,翻了一下history看了一下,找到一条,不记得是不是了。
sudo pip install virtualenvwrapper
# mysql
这个很顺利,直截就装好了。
sudo apt-get install mysql-server
# django
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)
django-bootstrap3
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)
djangorestframework
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)
#MySQLdb
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数据库了。
(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