所以我想在我的mac上设置一个python virutalenv来运行一些测试。
我已经从here安装了MySQL社区服务器5.6.16。
Downloading/unpacking MySQL-python==1.2.4
Using download cache from /Users/craig.vyvial/code/private/Cloud-Database/output/tox-cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FM%2FMySQL-python%2FMySQL-python-1.2.4.zip
Running setup.py (path:/Users/craig.vyvial/.cdb-venv/build/MySQL-python/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/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac
Now working in /var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28
Building a Distribute egg in /Users/craig.vyvial/.cdb-venv/build/MySQL-python
Traceback (most recent call last):
File "setup.py", line 220, in <module>
scripts = scripts,
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 113, in setup
_setup_distribution = dist = klass(attrs)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 270, in __init__
self.finalize_options()
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 2029, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 825, in best_match
return self.obtain(req, installer) # try and download/install
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 837, in obtain
return installer(requirement)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 272, in fetch_build_egg
dist = self.__class__({'script_args':['easy_install']})
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 270, in __init__
self.finalize_options()
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 257, in finalize_options
ep.require(installer=self.fetch_build_egg)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 2029, in require
working_set.resolve(self.dist.requires(self.extras),env,installer))
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 580, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 825, in best_match
return self.obtain(req, installer) # try and download/install
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 837, in obtain
return installer(requirement)
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 272, in fetch_build_egg
dist = self.__class__({'script_args':['easy_install']})
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/setuptools/dist.py", line 225, in __init__
_Distribution.__init__(self,attrs)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 270, in __init__
... ... ...
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 2128, in __init__
self.project_name = safe_name(project_name or 'Unknown')
File "/private/var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28/pkg_resources.py", line 1139, in safe_name
return re.sub('[^A-Za-z0-9.]+', '-', name)
File "/Users/craig.vyvial/.cdb-venv/lib/python2.6/re.py", line 151, in sub
return _compile(pattern, 0).sub(repl, string, count)
RuntimeError: maximum recursion depth exceeded
/Users/craig.vyvial/.cdb-venv/build/MySQL-python/distribute-0.6.28-py2.6.egg
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/Users/craig.vyvial/.cdb-venv/build/MySQL-python/setup.py", line 7, in <module>
use_setuptools()
File "distribute_setup.py", line 145, in use_setuptools
return _do_download(version, download_base, to_dir, download_delay)
File "distribute_setup.py", line 125, in _do_download
_build_egg(egg, tarball, to_dir)
File "distribute_setup.py", line 116, in _build_egg
raise IOError('Could not build the egg.')
IOError: Could not build the egg.
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac
Now working in /var/folders/dk/_qm8gn1123xd68l5gwd5c8xxp9_yj1/T/tmpaIssac/distribute-0.6.28
Building a Distribute egg in /Users/craig.vyvial/.cdb-venv/build/MySQL-python
Traceback (most recent call last):
因此,它会以递归深度出错。
通过一些谷歌搜索,我尝试了很多东西,但还没有解决这个问题。当我设置我的10.8.5 Mac时,我没有看到这个。这似乎与Mavericks的安装方式有关......
欢迎提示。
谢谢, 克雷格
答案 0 :(得分:4)
我认为这将解决您的问题:https://stackoverflow.com/a/21477404/423218 Stackoverflow将我的“琐碎答案”转换为评论,这是一种垃圾,因为它是一个合法的答案。所以也许通过添加更多的文字来解释这不是一个简单的答案,它不会再像那样做愚蠢的事了。
它的要点是你需要使用mysql的1.2.5版本。