Question

So i am trying to setup a python virutalenv on my mac to run some tests.

I've installed MySQL Community Server 5.6.16 from here.

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):      

So it errors out with a recursion depth.

With a bit of googling i've tried many things but nothing has resolved this issue yet. I did not see this when I setup my 10.8.5 Mac. This seems something related maybe to the way Mavericks is installed...

Ideas welcome.

Thanks, Craig

Était-ce utile?

La solution


I think this will solve your problem: https://stackoverflow.com/a/21477404/423218 Stackoverflow converted my "Trivial answer" to a comment instead, which is kind of garbage, because it's a legit answer. So maybe by adding a bit more text explaining that it's not a trivial answer, it won't do silly things like that any more.

The gist of it is you need to use vers 1.2.5 of the mysql thingy.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top