【问题标题】:Installing Django: Using XAMPP's MySQL, MySQL-python 1.2.3 & 1.2.4 errors?安装 Django:使用 XAMPP 的 MySQL、MySQL-python 1.2.3 和 1.2.4 错误?
【发布时间】:2013-07-11 19:00:58
【问题描述】:

我正在关注 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 位

【问题讨论】:

标签: python mysql django xampp mysql-python


【解决方案1】:

主要问题在这里:

Setup script exited with error: Unable to find vcvarsall.bat

这意味着你的CC++没有被编译。如果您最近安装了 Visual Studio 2012,那么请按照我的回答 here 来查找您的问题的解决方案。

【讨论】:

  • 谢谢,这似乎已经解决了 1.2.4 的错误。 1.2.3 错误仍然出现,但显然它在谈论不同的文件。即使出现错误,我仍然觉得 1.2.3 似乎如何工作很有趣。可能由于逻辑错误或其他原因导致错误消息出错。
  • 啊,我没有足够的声望来投票...不过我想我接受了。
猜你喜欢
  • 2011-02-01
  • 2018-02-11
  • 2011-10-20
  • 1970-01-01
  • 1970-01-01
  • 2017-07-31
  • 2015-08-22
  • 2023-04-09
相关资源
最近更新 更多