【问题标题】:Trouble installing python [closed]安装python时遇到问题[关闭]
【发布时间】:2013-12-13 16:51:09
【问题描述】:

我在 OSX Mavericks 上安装 mysql-python 时遇到了一些问题。所以我这样做了

pip install mysql-python

我得到了这个输出。

Downloading/unpacking mysql-python
  Downloading MySQL-python-1.2.4.zip (113kB): 113kB downloaded
  Running setup.py egg_info for package mysql-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/wl/wh6bdcxx2psbvyncp8y8br340000gn/T/tmpXUZzMR
Now working in /var/folders/wl/wh6bdcxx2psbvyncp8y8br340000gn/T/tmpXUZzMR/distribute-0.6.28
Building a Distribute egg in /private/var/folders/wl/wh6bdcxx2psbvyncp8y8br340000gn/T/pip_build_fredericmaurer/mysql-python
/private/var/folders/wl/wh6bdcxx2psbvyncp8y8br340000gn/T/pip_build_fredericmaurer/mysql-python/distribute-0.6.28-py2.7.egg

Installing collected packages: mysql-python
  Running setup.py install for mysql-python
building '_mysql' extension
/usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,4,'final',1) -D__version__=1.2.4 -I/usr/local/Cellar/mysql/5.6.14/include/mysql -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.14/include/mysql/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
  #define SIZEOF_SIZE_T  SIZEOF_LONG
          ^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:56:17: note: previous definition is here
#        define SIZEOF_SIZE_T           4
                ^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.14/include/mysql/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
#define HAVE_WCSCOLL
        ^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:902:9: note: previous definition is here
#define HAVE_WCSCOLL 1
        ^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.14/include/mysql/my_config.h:659:9: warning: 'SIZEOF_TIME_T' macro redefined
#define SIZEOF_TIME_T 8
        ^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:57:17: note: previous definition is here
#        define SIZEOF_TIME_T           4
                ^
_mysql.c:1567:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if (how < 0 || how >= sizeof(row_converters)) {
            ~~~ ^ ~
4 warnings generated.
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.14/include/mysql/my_config.h:348:11: warning: 'SIZEOF_SIZE_T' macro redefined
  #define SIZEOF_SIZE_T  SIZEOF_LONG
          ^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pymacconfig.h:43:17: note: previous definition is here
#        define SIZEOF_SIZE_T           8
                ^
In file included from _mysql.c:44:
/usr/local/Cellar/mysql/5.6.14/include/mysql/my_config.h:442:9: warning: 'HAVE_WCSCOLL' macro redefined
#define HAVE_WCSCOLL
        ^
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pyconfig.h:902:9: note: previous definition is here
#define HAVE_WCSCOLL 1
        ^
_mysql.c:1567:10: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
        if (how < 0 || how >= sizeof(row_converters)) {
            ~~~ ^ ~
3 warnings generated.

我在尝试手动安装时收到相同的错误消息。 有人知道吗? 我用谷歌搜索但找不到任何解决方案。

感谢您的帮助。

【问题讨论】:

  • 检查它是否实际安装(通过尝试使用它)。控制台输出中没有错误消息。

标签: python mysql-python osx-mavericks


【解决方案1】:

MySQL-python 1.2.4 只支持到 MySQL 5.5

【讨论】:

  • 这就是问题所在。我有 5.6 版。我切换到 5.5,问题就消失了。非常感谢。
猜你喜欢
  • 1970-01-01
  • 2022-01-21
  • 2022-01-03
  • 1970-01-01
  • 2023-04-09
  • 2018-01-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多