我正在关注this关于如何安装 python 的精彩演练。
我不认为我有真正的问题,因为...我认为我能够处理我的 django 项目...但是我遇到了一些错误,我只是跳过了这些错误,我想知道他们来自哪里。
一切都进展顺利,直到我到达安装 MySQL-python 的部分。我实际上是通过 XAMPP 使用 MySQL...所以如果这是问题,请告诉我。
我尝试安装 MySQL-python v1.2.3 并收到此错误:
Processing MySQL-python-1.2.3.win-amd64-py2.7.exe
creating 'c:\users\quentin\appdata\local\temp\easy_install-reydf8\MySQL_python-1.2.3-py2.7-win32.egg' and adding 'c:\users\quentin\appdata\local\temp\easy_install-reydf8\MySQL_python-1.2.3-py2.7-win32.egg.tmp' to it
Moving MySQL_python-1.2.3-py2.7-win32.egg to c:\virtualenvs\django_tutorial\lib\site-packages
Adding MySQL-python 1.2.3 to easy-install.pth file
Installed c:\virtualenvs\django_tutorial\lib\site-packages\mysql_python-1.2.3-py2.7-win32.egg
Processing dependencies for MySQL-python==1.2.3
Searching for MySQL-python==1.2.3
Reading http://pypi.python.org/simple/MySQL-python/
Best match: MySQL-python 1.2.3
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.3.tar.gz#md5=215eddb6d853f6f4be5b4afc4154292f
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3\setup.py -q bdist_egg --dist-dir c:\users\quentin\appdata\local\temp\easy_install-cnlqlk\MySQL-python-1.2.3\egg-dist-tmp-iaalng
error: The system cannot find the file specified
所以通常我认为 1.2.3 没有安装,但我认为它安装了,因为这个命令有效......
python manage.py syncdb
所以我有点好奇那个关于找不到系统文件的错误消息来自哪里。
我还尝试安装 v1.2.4,但在查找另一个文件时遇到类似的错误:
(django_tutorial) C:\django_projects\insults>easy_install file://c:/users/quentin/downloads/mysql-python-1.2.4.win-amd64-py2.7.exe
Processing mysql-python-1.2.4.win-amd64-py2.7.exe
creating 'c:\users\quentin\appdata\local\temp\easy_install-hz3ivi\MySQL_python-1.2.4-py2.7-win32.egg' and adding 'c:\users\quentin\appdata\local\temp\easy_install-hz3ivi\MySQL_python-1.2.4-py2.7-win32.egg.tmp' to it
Moving MySQL_python-1.2.4-py2.7-win32.egg to c:\virtualenvs\django_tutorial\lib\site-packages
Removing mysql-python 1.2.3 from easy-install.pth file
Adding MySQL-python 1.2.4 to easy-install.pth file
Installed c:\virtualenvs\django_tutorial\lib\site-packages\mysql_python-1.2.4-py2.7-win32.egg
Processing dependencies for MySQL-python==1.2.4
Searching for MySQL-python==1.2.4
Reading http://pypi.python.org/simple/MySQL-python/
Best match: MySQL-python 1.2.4
Downloading https://pypi.python.org/packages/source/M/MySQL-python/MySQL-python1.2.4.zip#md5=ddf2386daf10a97af115ffad2ed4a9a0
Processing MySQL-python-1.2.4.zip
Running MySQL-python-1.2.4\setup.py -q bdist_egg --dist-dir c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\egg-dist-tmp-2ltuob
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\temp\tmpemj6wf
Now working in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\temp\tmpemj6wf\distribute-0.6.28
Building a Distribute egg in c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4
c:\users\quentin\appdata\local\temp\easy_install-v0_gfa\MySQL-python-1.2.4\distribute0.6.28-py2.7.egg
error: Setup script exited with error: Unable to find vcvarsall.bat
所以是的。只是对这些错误有点好奇,以及我是否应该担心它们。我想如果一切正常,我真的没有问题,但是...其他人可能也会对此感到困惑,并陷入 django 工作的安装/设置部分?
编辑 好吧,当我安装 1.2.4 时,它并不高兴,但如果我在它上面安装 1.2.3,syncdb 会再次工作。
MySQL-python 1.2.3/1.2.4
Django 1.5.1
XAMPP3.1.0、Apache2.4.3、MySQL5.5.32
Python 2.7.5 64 位
Windows 7 64 位
最佳答案
主要问题在这里:
Setup script exited with error: Unable to find vcvarsall.bat
这意味着您的C
和C++
未编译。如果你最近安装了Visual Studio 2012,那么按照我的回答here ,找到问题的解决方案。
关于python - 安装 Django : Using XAMPP's MySQL, MySQL-python 1.2.3 和 1.2.4 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17628402/