OS X Mountain Lion으로 업그레이드 한 후 Python Virtualenv가 손상되었습니다.


7

Mountain Lion으로 업그레이드 한 후 "virtualenv env"명령을 실행하면 다음을 얻었습니다.

New python executable in env/bin/python
Installing setuptools.........
  Complete output from command /Users/agoodattitude...ncode/env/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" /Library/Python/2.7/...ols-0.6c11-py2.7.egg:
  Processing setuptools-0.6c11-py2.7.egg
Removing /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
Copying setuptools-0.6c11-py2.7.egg to /Library/Python/2.7/site-packages
setuptools 0.6c11 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
error: /usr/local/bin/easy_install: Permission denied
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.7.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1052, in create_environment
    search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 598, in install_setuptools
    search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 570, in _install_req
    cwd=cwd)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/agoodattitude...xxxxx/env/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" /Library/Python/2.7/...ols-0.6c11-py2.7.egg failed with error code 1

어떤 아이디어?

편집 : 나는 지금 얻는다 :

New python executable in env/bin/python
Installing setuptools.............done.
Installing pip....
  Complete output from command /Users/agoodattitude...ncode/env/bin/python -x /Users/agoodattitude...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz:
  /Users/agoodattitude/saff-py/xxxxxx/env/bin/python: can't open file '/Users/agoodattitude/saff-py/xxxxx/env/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.7.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1054, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 654, in install_pip
    filter_stdout=_filter_setup)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/agoodattitude...xxxx/env/bin/python -x /Users/agoodattitude...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz failed with error code 2

메시지 더보기 :

>>> sudo virtualenv -vvv env
Password:
Creating env/lib/python2.7
Symlinking Python bootstrap modules
  Symlinking env/lib/python2.7/config
  Symlinking env/lib/python2.7/lib-dynload
  Symlinking env/lib/python2.7/os.py
  Ignoring built-in bootstrap module: posix
  Symlinking env/lib/python2.7/posixpath.py
  Cannot import bootstrap module: nt
  Symlinking env/lib/python2.7/ntpath.py
  Symlinking env/lib/python2.7/genericpath.py
  Symlinking env/lib/python2.7/fnmatch.py
  Symlinking env/lib/python2.7/locale.py
  Symlinking env/lib/python2.7/encodings
  Symlinking env/lib/python2.7/codecs.py
  Symlinking env/lib/python2.7/stat.py
  Symlinking env/lib/python2.7/UserDict.py
  File env/lib/python2.7/lib-dynload/readline.so already exists
  Symlinking env/lib/python2.7/copy_reg.py
  Symlinking env/lib/python2.7/types.py
  Symlinking env/lib/python2.7/re.py
  Symlinking env/lib/python2.7/sre.py
  Symlinking env/lib/python2.7/sre_parse.py
  Symlinking env/lib/python2.7/sre_constants.py
  Symlinking env/lib/python2.7/sre_compile.py
  File env/lib/python2.7/lib-dynload/zlib.so already exists
  Symlinking env/lib/python2.7/warnings.py
  Symlinking env/lib/python2.7/linecache.py
  Symlinking env/lib/python2.7/_abcoll.py
  Symlinking env/lib/python2.7/abc.py
  Symlinking env/lib/python2.7/_weakrefset.py
Creating env/lib/python2.7/site-packages
Writing env/lib/python2.7/site.py
Writing env/lib/python2.7/orig-prefix.txt
Writing env/lib/python2.7/no-global-site-packages.txt
Creating parent directories for env/include
Symlinking env/include/python2.7
Creating env/bin
New python executable in env/bin/python
Changed mode of env/bin/python to 0755
MacOSX Python framework detected
Symlinking env/.Python
Testing executable with env/bin/python -c "import sys;out=sys.stdout;getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))"
Got sys.prefix result: u'/Users/agoodattitude/saff-py/sdfsd/env'
Creating env/lib/python2.7/distutils
Writing env/lib/python2.7/distutils/__init__.py
Writing env/lib/python2.7/distutils/distutils.cfg
Using existing setuptools egg: /Library/Python/2.7/site-packages/virtualenv_support/setuptools-0.6c11-py2.7.egg
Installing setuptools...
  Running command /Users/agoodattitude...dfdf/env/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])

" -v /Library/Python/2.7/...ols-0.6c11-py2.7.egg
  Processing setuptools-0.6c11-py2.7.egg
  Removing /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
  Copying setuptools-0.6c11-py2.7.egg to /Library/Python/2.7/site-packages
  setuptools 0.6c11 is already the active version in easy-install.pth
  Installing easy_install script to /usr/local/bin
  changing mode of /usr/local/bin/easy_install to 755
  Installing easy_install-2.7 script to /usr/local/bin
  changing mode of /usr/local/bin/easy_install-2.7 to 755

  Installed /Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg
  Processing dependencies for setuptools==0.6c11
  Finished processing dependencies for setuptools==0.6c11
...Installing setuptools...done.
Installing existing pip-1.1.tar.gz distribution: /Library/Python/2.7/site-packages/virtualenv_support/pip-1.1.tar.gz
Installing pip...
  Running command /Users/agoodattitude...dfdf/env/bin/python -x /Users/agoodattitude...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz
  /Users/agoodattitude/saff-py/sdfsdf/env/bin/python: can't open file '/Users/agoodattitude/saff-py/sdencode/env/bin/easy_install': [Errno 2] No such file or directory
  Complete output from command /Users/agoodattitude...dfdf/env/bin/python -x /Users/agoodattitude...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz:
  /Users/agoodattitude/saff-py/sdfsdf/env/bin/python: can't open file '/Users/agoodattitude/saff-py/sdfsdf/env/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.7.2', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1054, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 654, in install_pip
    filter_stdout=_filter_setup)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /Users/agoodattitude...dfdfdf/env/bin/python -x /Users/agoodattitude...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz failed with error code 2

1
해당 추적의 첫 번째 오류는 다음과 같습니다. / usr / local / bin / easy_install : 사용 권한이 거부되었습니다. 따라서 / usr / local / bin에 대한 사용 권한을 확인하고 sudo chown xxx를 사용하여 액세스 권한을 수정하지 않은 경우 확인해야합니다.
Jimmy Hillis

답변:


9

다운로드해야합니다. Command Line Tools 마운틴 라이온.

설치된 Xcode :

Xcode (Xcode -> Preferences)의 환경 설정으로 이동하여 'Downloads'탭을 선택하고 설치를 선택하십시오. Command Line Tools

Xcode가 설치되지 않았습니다.

Apple은 Mountain Lion (OS X 10.8. *)과 호환되는 명령 행 도구 패키지를 출시했습니다. Apple 개발자 다운로드 페이지 . 이를 위해 무료 개발자 계정이 필요합니다.


또한 이것은 파이썬 트위스트가 다른 가상 환경에 설치되지 않는 이유이기도합니다.
Danny Staple

5

앱 스토어에서 Xcode 4.4를 설치하고 xcode를 열어야합니다. Xcode > Preferences (또는 Cmd + , ) 그런 다음 downloads 탭을 클릭하고 Command Line Tools.


3

나를 위해, 명령 줄 도구를 설치 한 후, easy_install 에있다 /usr/bin, 아니라 /usr/local/bin. 나 제거해야했습니다. easy_install ...에서 /usr/local/bin:

$ sudo rm /usr/local/bin/easy_install*

(내 경우에는) easy_install, easy_install-2.6, 및 easy_install-2.7


1

나는 비슷한 방향으로이 문제를 풀려고했다.

  • 나는 지웠다 /usr/bin/easy_install (필요한 경우 확실하지 않음)
  • 양조에 의해 설치된 EASY_INSTALL을 사용하여 설치된 VERTUALENV /usr/local

그리고 모든 좋은!

Virtualenv는 정말로 갈 길입니다.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.