Question

i am trying to install virtualenv to use python2.5 on my apple OSX 10.6 machine, but get this error when i try to:

☺  virtualenv --python=python2.5 /Users/khinester/.virtualenvs/cccorder2.5                                                                                       ruby-2.0.0-p195""
Running virtualenv with interpreter /usr/bin/python2.5
New python executable in /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5
Not overwriting existing python script /Users/khinester/.virtualenvs/cccorder2.5/bin/python (you must use /Users/khinester/.virtualenvs/cccorder2.5/bin/python2.5)
Installing setuptools......................................
  Complete output from command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])





" --always-copy -U setuptools:
  Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
Searching for setuptools
Reading http://pypi.python.org/simple/setuptools/
Reading http://peak.telecommunity.com/snapshots/
Reading https://pypi.python.org/pypi/setuptools
Best match: setuptools 3.3
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-3.3.zip#md5=284fa92c5e32c113a4bc00bd20c4eef8
Processing setuptools-3.3.zip
Running setuptools-3.3/setup.py -q bdist_egg --dist-dir /var/folders/it/itEAjVAME2GWcW-Q6QxMBU+++TI/-Tmp-/easy_install-5rSJOe/setuptools-3.3/egg-dist-tmp-IL4Z_W
setup.py:17: Warning: 'with' will become a reserved keyword in Python 2.6
Traceback (most recent call last):
  File "<string>", line 278, in <module>
  File "<string>", line 213, in main
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1712, in main
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/distutils/dist.py", line 994, in run_command
    cmd_obj.run()
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 211, in run
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 476, in install_item
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 62, in run_setup
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 105, in run
  File "/Users/khinester/setuptools-0.6c11-py2.5.egg/setuptools/sandbox.py", line 64, in <lambda>
  File "setup.py", line 17
    with open(init_path) as init_file:
            ^
SyntaxError: invalid syntax
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 2577, in <module>
    main()
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 979, in main
    no_pip=options.no_pip)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1091, in create_environment
    search_dirs=search_dirs, never_download=never_download)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 611, in install_setuptools
    search_dirs=search_dirs, never_download=never_download)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 583, in _install_req
    cwd=cwd)
  File "/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv-1.9.1-py2.7.egg/virtualenv.py", line 1057, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/khinester/.vi...der2.5/bin/python2.5 -c "#!python
\"\"\"Bootstra...sys.argv[1:])






" --always-copy -U setuptools failed with error code 1

all other versions of python work fine, but just this.

python2.5 is fine on the machine, as per:

☺  python2.5                                                                                                                                                     ruby-2.0.0-p195""
Python 2.5.4 (r254:67916, Aug  1 2011, 15:52:49)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print( sys.path )
['', '/Library/Python/2.5/site-packages/virtualenv-1.11.4-py2.5.egg', '/Library/Python/2.5/site-packages/MySQL_python-1.2.5-py2.5-macosx-10.6-i386.egg', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python25.zip', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload', '/Library/Python/2.5/site-packages', '/Library/Python/2.5/site-packages/PIL', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/PyObjC', '/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python/wx-2.8-mac-unicode']
>>>

any advice much appreciated.

Était-ce utile?

La solution

I think your issue is not with virtualenv but with setuptools, that dropped python 2.5 support a few months ago. You should install an older version (probably 1.X)

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