mac: install_name_tool breaks on 64-bit Python 2.7 | Leopard only #7

Open
vbabiy opened this Issue Mar 14, 2011 · 32 comments

Comments

Projects
None yet
@vbabiy
Contributor

vbabiy commented Mar 14, 2011

#!python

$ /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv --distribute --no-site-packages /tmp/v2New python executable in /tmp/v2/bin/python
install_name_tool: for architecture i386 object: /tmp/v2/bin/python malformed object (unknown load command 4)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.4.9', 'console_scripts', 'virtualenv')()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 534, in main
    use_distribute=options.use_distribute)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 617, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 811, in install_python
    py_executable])
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 595, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /Library/Frameworks/Python.fra...ython @executable_path/../.Python /tmp/v2/bin/python failed with error code 1



$ /Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv --version
1.4.9
$ /Library/Frameworks/Python.framework/Versions/2.7/bin/python --version
Python 2.7

I used ActivePython 2.7.0.1 - but I do believe this also reproduces on Python 2.7 64-bit dmg. This can only be reproduced on 10.5 (neither 10.4 nor 10.6).


@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed title from install_name_tool breaks on 64-bit 2.7 to
    install_name_tool breaks on 64-bit Python 2.7.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed title from install_name_tool breaks on 64-bit 2.7 to
    install_name_tool breaks on 64-bit Python 2.7.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed content.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed content.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed title from install_name_tool breaks on 64-bit Python 2.7 to mac:
    install_name_tool breaks on 64-bit Python 2.7.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed title from install_name_tool breaks on 64-bit Python 2.7 to mac:
    install_name_tool breaks on 64-bit Python 2.7.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed title from mac: install_name_tool breaks on 64-bit Python 2.7 to
    mac: install_name_tool breaks on 64-bit Python 2.7 | Leopard only.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed title from mac: install_name_tool breaks on 64-bit Python 2.7 to
    mac: install_name_tool breaks on 64-bit Python 2.7 | Leopard only.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed content.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed content.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor
  • Changed content.

Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

  • Changed content.

Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

I wasn't able to reproduce this but might be related to what was done in
[Author: jezdez

Age: 8 months ago

Fixed 32 - Partially reverted the changes made in r03bf4040094c to fix setting
up cross Python version virtualenv.">r312:4f8d56657fd3]1 .


Original Comment By: Jannis Leidel
Contributor

vbabiy commented Mar 14, 2011

I wasn't able to reproduce this but might be related to what was done in
[Author: jezdez

Age: 8 months ago

Fixed 32 - Partially reverted the changes made in r03bf4040094c to fix setting
up cross Python version virtualenv.">r312:4f8d56657fd3]1 .


Original Comment By: Jannis Leidel
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

I just saw this on Python 2.6.6c2 built with 10.5 SDK --universal-intel
(i386+x86_64). On a Leopard machine.

@jezdez - was there a new release since that change? I have virtualenv 1.4.9
that has the following piece of code:

  1. Make sure we use the the embedded interpreter inside
  2. the framework, even if sys.executable points to
  3. the stub executable in ${sys.prefix}/bin
  4. See http://groups.google.com/group/python-virtualenv/
  5. browse_thread/thread/17cab2f85da75951 shutil.copy( os.path.join( prefix,
    'Resources/Python.app/Contents/MacOS/%s' % os.path.basename(sys.executable)),
    py_executable)

My sys.executable is Contents/MacOS/Python-32


Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

I just saw this on Python 2.6.6c2 built with 10.5 SDK --universal-intel
(i386+x86_64). On a Leopard machine.

@jezdez - was there a new release since that change? I have virtualenv 1.4.9
that has the following piece of code:

  1. Make sure we use the the embedded interpreter inside
  2. the framework, even if sys.executable points to
  3. the stub executable in ${sys.prefix}/bin
  4. See http://groups.google.com/group/python-virtualenv/
  5. browse_thread/thread/17cab2f85da75951 shutil.copy( os.path.join( prefix,
    'Resources/Python.app/Contents/MacOS/%s' % os.path.basename(sys.executable)),
    py_executable)

My sys.executable is Contents/MacOS/Python-32


Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

@srid: No there wasn't a release since then, please try again with
virtualenv==dev.


Original Comment By: Jannis Leidel
Contributor

vbabiy commented Mar 14, 2011

@srid: No there wasn't a release since then, please try again with
virtualenv==dev.


Original Comment By: Jannis Leidel
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

@jezdez: I get the same error with virtualenv==dev. I also tried directly
using the tip
http://bitbucket.org/ianb/virtualenv/raw/590ef6e06a3d/virtualenv.py


Original Comment By: Sridhar Ratnakumar
Contributor

vbabiy commented Mar 14, 2011

@jezdez: I get the same error with virtualenv==dev. I also tried directly
using the tip
http://bitbucket.org/ianb/virtualenv/raw/590ef6e06a3d/virtualenv.py


Original Comment By: Sridhar Ratnakumar
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

@srid: Ok, thanks, reopening then.


Original Comment By: Jannis Leidel
Contributor

vbabiy commented Mar 14, 2011

@srid: Ok, thanks, reopening then.


Original Comment By: Jannis Leidel
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

I get the same thing in ActivePython 2.7.0.2 / OS X 10.5.8


Original Comment By: Anonymous
Contributor

vbabiy commented Mar 14, 2011

I get the same thing in ActivePython 2.7.0.2 / OS X 10.5.8


Original Comment By: Anonymous
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

If anyone with access to Leopard would help out with this, it'd be much
appreciated.


Original Comment By: Jannis Leidel
Contributor

vbabiy commented Mar 14, 2011

If anyone with access to Leopard would help out with this, it'd be much
appreciated.


Original Comment By: Jannis Leidel
@vbabiy

This comment has been minimized.

Show comment Hide comment
@vbabiy

vbabiy Mar 14, 2011

Contributor

The same error occurs on the Mac OS X Lion developer preview:

amcgregor@Hamaliel ~/Projects $ virtualenv --no-site-packages --distribute

Contentment

New python executable in Contentment/bin/python

install_name_tool: for architecture x86_64 object: Contentment/bin/python

malformed object (unknown load command 9)

Could not call install_name_tool -- you must have Apple's development

tools installed

Traceback (most recent call last):

  File "/usr/local/bin/virtualenv", line 9, in <module>

    load_entry_point('virtualenv==1.5.1', 'console_scripts',

'virtualenv')()

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 558, in main

    prompt=options.prompt)

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 647, in
create_environment

    site_packages=site_packages, clear=clear))

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 900, in
install_python

    py_executable])

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 624, in
call_subprocess

    % (cmd_desc, proc.returncode))

OSError: Command install_name_tool -change

/System/Library/Frameworks/Pyt...ython @executable_path/../.Python
Contentment/bin/python failed with error code 1

Testing again with virtualenv==dev results in the same failure using:

Python 2.7.1 (r271:86832, Feb  6 2011, 16:42:58)

[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.8)] on darwin

Original Comment By: Alice Bevan-McGregor
Contributor

vbabiy commented Mar 14, 2011

The same error occurs on the Mac OS X Lion developer preview:

amcgregor@Hamaliel ~/Projects $ virtualenv --no-site-packages --distribute

Contentment

New python executable in Contentment/bin/python

install_name_tool: for architecture x86_64 object: Contentment/bin/python

malformed object (unknown load command 9)

Could not call install_name_tool -- you must have Apple's development

tools installed

Traceback (most recent call last):

  File "/usr/local/bin/virtualenv", line 9, in <module>

    load_entry_point('virtualenv==1.5.1', 'console_scripts',

'virtualenv')()

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 558, in main

    prompt=options.prompt)

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 647, in
create_environment

    site_packages=site_packages, clear=clear))

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 900, in
install_python

    py_executable])

  File "/Library/Python/2.7/site-

packages/virtualenv-1.5.1-py2.7.egg/virtualenv.py", line 624, in
call_subprocess

    % (cmd_desc, proc.returncode))

OSError: Command install_name_tool -change

/System/Library/Frameworks/Pyt...ython @executable_path/../.Python
Contentment/bin/python failed with error code 1

Testing again with virtualenv==dev results in the same failure using:

Python 2.7.1 (r271:86832, Feb  6 2011, 16:42:58)

[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.8)] on darwin

Original Comment By: Alice Bevan-McGregor
@welchr

This comment has been minimized.

Show comment Hide comment
@welchr

welchr Jul 1, 2011

Same issue on OS X 10.6.8 with Python 2.6.1 using virtualenv 1.6.1:

New python executable in testenv/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.6/Python @executable_path/../.Python testenv/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
File "virtualenv-1.6.1/virtualenv.py", line 1965, in
main()
File "virtualenv-1.6.1/virtualenv.py", line 795, in main
never_download=options.never_download)
File "virtualenv-1.6.1/virtualenv.py", line 886, in create_environment
site_packages=site_packages, clear=clear))
File "virtualenv-1.6.1/virtualenv.py", line 1150, in install_python
py_executable])
File "virtualenv-1.6.1/virtualenv.py", line 828, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in init
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
OSError: [Errno 2] No such file or directory

Looks like virtualenv doesn't work without the Apple developer tools?

welchr commented Jul 1, 2011

Same issue on OS X 10.6.8 with Python 2.6.1 using virtualenv 1.6.1:

New python executable in testenv/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.6/Python @executable_path/../.Python testenv/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
File "virtualenv-1.6.1/virtualenv.py", line 1965, in
main()
File "virtualenv-1.6.1/virtualenv.py", line 795, in main
never_download=options.never_download)
File "virtualenv-1.6.1/virtualenv.py", line 886, in create_environment
site_packages=site_packages, clear=clear))
File "virtualenv-1.6.1/virtualenv.py", line 1150, in install_python
py_executable])
File "virtualenv-1.6.1/virtualenv.py", line 828, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 595, in init
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py", line 1106, in _execute_child
OSError: [Errno 2] No such file or directory

Looks like virtualenv doesn't work without the Apple developer tools?

@jezdez

This comment has been minimized.

Show comment Hide comment
@jezdez

jezdez Jul 1, 2011

Contributor

Yeah, the developer tools are an dependency on Mac OS.

Contributor

jezdez commented Jul 1, 2011

Yeah, the developer tools are an dependency on Mac OS.

@splee

This comment has been minimized.

Show comment Hide comment
@splee

splee Jul 23, 2011

I am getting this using Lion (upgraded from Snow Leopard). I reinstalled Xcode and virtualenv to no avail:

$ mkvirtualenv pongdom
New python executable in pongdom/bin/python
install_name_tool: for architecture x86_64 object: pongdom/bin/python malformed object (unknown load command 9)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 810, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 901, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1166, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 878, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pongdom/bin/python failed with error code 1

splee commented Jul 23, 2011

I am getting this using Lion (upgraded from Snow Leopard). I reinstalled Xcode and virtualenv to no avail:

$ mkvirtualenv pongdom
New python executable in pongdom/bin/python
install_name_tool: for architecture x86_64 object: pongdom/bin/python malformed object (unknown load command 9)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 810, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 901, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1166, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 878, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pongdom/bin/python failed with error code 1
@jezdez

This comment has been minimized.

Show comment Hide comment
@jezdez

jezdez Jul 25, 2011

Contributor

Which python did you use to run virtualenv and more importantly which python does virtualenv use? (see the first line of the virtualenv script)

The default Python version was upgrade from 2.6 to 2.7 so it might be possible that there is a stale virtualenv somewhere.

Note: I've upgraded myself from Snow Leopard to Lion on a 64bit machine and didn't encounter the described problem.

Contributor

jezdez commented Jul 25, 2011

Which python did you use to run virtualenv and more importantly which python does virtualenv use? (see the first line of the virtualenv script)

The default Python version was upgrade from 2.6 to 2.7 so it might be possible that there is a stale virtualenv somewhere.

Note: I've upgraded myself from Snow Leopard to Lion on a 64bit machine and didn't encounter the described problem.

@dedan

This comment has been minimized.

Show comment Hide comment
@dedan

dedan Aug 3, 2011

I have the same on a clean install of Lion. Installed everything from scratch and get the following error:

New python executable in pyff/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pyff/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 810, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 901, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 1166, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 843, in call_subprocess
    cwd=cwd, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
OSError: [Errno 2] No such file or directory

also on a 64 bit machine

dedan commented Aug 3, 2011

I have the same on a clean install of Lion. Installed everything from scratch and get the following error:

New python executable in pyff/bin/python
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pyff/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 810, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 901, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 1166, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv-1.6.4-py2.7.egg/virtualenv.py", line 843, in call_subprocess
    cwd=cwd, env=env)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
OSError: [Errno 2] No such file or directory

also on a 64 bit machine

@bretth

This comment has been minimized.

Show comment Hide comment
@bretth

bretth Aug 18, 2011

Lion users - When you Install Xcode via the app store it's only installing the INSTALLER. You need to run the installer from applications to actually install Xcode.

Who would have thought that when the App store says installed it's not actually installed but there you go!

This of course solved the mystery of the missing install_name_tool

bretth commented Aug 18, 2011

Lion users - When you Install Xcode via the app store it's only installing the INSTALLER. You need to run the installer from applications to actually install Xcode.

Who would have thought that when the App store says installed it's not actually installed but there you go!

This of course solved the mystery of the missing install_name_tool

@gorakhargosh

This comment has been minimized.

Show comment Hide comment
@gorakhargosh

gorakhargosh Sep 7, 2011

Umm. I have Xcode installed, but still no go. Weird. The funny part is it was working earlier. =
Here's the stacktrace:

_____________________________________________________________________________ [tox testenv:py27] ______________________________________________________________________________
[TOX] ***creating virtualenv py27
[TOX] /Volumes/data/Projects/mom/.tox$ /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 >py27/log/0.log
[TOX] ERROR: invocation failed, logfile: /Volumes/data/Projects/mom/.tox/py27/log/0.log
[TOX] ERROR: /Volumes/data/Projects/mom/.tox$ /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 >py27/log/0.log
install_name_tool: for architecture cputype (16777223) cpusubtype (-2147483645) object: py27/bin/python malformed object (unknown load command 4)
New python executable in py27/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 1922, in <module>
    main()
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 796, in main
    never_download=options.never_download)
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 887, in create_environment
    site_packages=site_packages, clear=clear))
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 1151, in install_python
    py_executable])
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 864, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python py27/bin/python failed with error code 1

[TOX] ERROR: InvocationError: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 (see /Volumes/data/Projects/mom/.tox/py27/log/0.log)

Umm. I have Xcode installed, but still no go. Weird. The funny part is it was working earlier. =
Here's the stacktrace:

_____________________________________________________________________________ [tox testenv:py27] ______________________________________________________________________________
[TOX] ***creating virtualenv py27
[TOX] /Volumes/data/Projects/mom/.tox$ /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 >py27/log/0.log
[TOX] ERROR: invocation failed, logfile: /Volumes/data/Projects/mom/.tox/py27/log/0.log
[TOX] ERROR: /Volumes/data/Projects/mom/.tox$ /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 >py27/log/0.log
install_name_tool: for architecture cputype (16777223) cpusubtype (-2147483645) object: py27/bin/python malformed object (unknown load command 4)
New python executable in py27/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 1922, in <module>
    main()
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 796, in main
    never_download=options.never_download)
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 887, in create_environment
    site_packages=site_packages, clear=clear))
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 1151, in install_python
    py_executable])
  File "../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py", line 864, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python py27/bin/python failed with error code 1

[TOX] ERROR: InvocationError: /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 ../../../../../Library/Python/2.7/site-packages/tox/virtualenv.py --distribute --no-site-packages py27 (see /Volumes/data/Projects/mom/.tox/py27/log/0.log)
@shacker

This comment has been minimized.

Show comment Hide comment
@shacker

shacker Sep 17, 2011

bretth - Thank you! I never would have guessed that. Sheesh.

shacker commented Sep 17, 2011

bretth - Thank you! I never would have guessed that. Sheesh.

@aidanlister

This comment has been minimized.

Show comment Hide comment
@aidanlister

aidanlister Nov 9, 2011

I'm experiencing this problem with Xcode installed also,

$ virtualenv --no-site-packages --distribute fiestagram
New python executable in fiestagram/bin/python
install_name_tool: object: fiestagram/bin/python malformed object (unknown load command 4)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.5.2', 'console_scripts', 'virtualenv')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 558, in main
    prompt=options.prompt)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 647, in create_environment
    site_packages=site_packages, clear=clear))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 901, in install_python
    py_executable])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 624, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /opt/local/Library/Frameworks/...ython @executable_path/../.Python fiestagram/bin/python failed with error code 1

This is using Python 2.7 from MacPorts as well as the native 2.7 in Snow Leopard.

I'm experiencing this problem with Xcode installed also,

$ virtualenv --no-site-packages --distribute fiestagram
New python executable in fiestagram/bin/python
install_name_tool: object: fiestagram/bin/python malformed object (unknown load command 4)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/virtualenv", line 9, in <module>
    load_entry_point('virtualenv==1.5.2', 'console_scripts', 'virtualenv')()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 558, in main
    prompt=options.prompt)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 647, in create_environment
    site_packages=site_packages, clear=clear))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 901, in install_python
    py_executable])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/virtualenv.py", line 624, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /opt/local/Library/Frameworks/...ython @executable_path/../.Python fiestagram/bin/python failed with error code 1

This is using Python 2.7 from MacPorts as well as the native 2.7 in Snow Leopard.

@fmeyer

This comment has been minimized.

Show comment Hide comment
@fmeyer

fmeyer Nov 11, 2011

After upgrade from snow leopard to Lion you should re-install Xcode.

fmeyer commented Nov 11, 2011

After upgrade from snow leopard to Lion you should re-install Xcode.

@aidanlister

This comment has been minimized.

Show comment Hide comment
@aidanlister

aidanlister Nov 12, 2011

I didn't upgrade, it's a new computer.

On 12 November 2011 05:27, Fernando Meyer
reply@reply.github.com
wrote:

After upgrade from snow leopard to Lion you should re-install Xcode.


Reply to this email directly or view it on GitHub:
#7 (comment)

I didn't upgrade, it's a new computer.

On 12 November 2011 05:27, Fernando Meyer
reply@reply.github.com
wrote:

After upgrade from snow leopard to Lion you should re-install Xcode.


Reply to this email directly or view it on GitHub:
#7 (comment)

@lxyu

This comment has been minimized.

Show comment Hide comment
@lxyu

lxyu Dec 29, 2011

Same problem here.

New python executable in pyramidenv/bin/python
install_name_tool: for architecture cputype (16777223) cpusubtype (-2147483645) object: pyramidenv/bin/python malformed object (unknown load command 4)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.7', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 928, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1029, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1296, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1006, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pyramidenv/bin/python failed with error code 1

But, the problem solved after I manually reinstalled the Xcode.

lxyu commented Dec 29, 2011

Same problem here.

New python executable in pyramidenv/bin/python
install_name_tool: for architecture cputype (16777223) cpusubtype (-2147483645) object: pyramidenv/bin/python malformed object (unknown load command 4)
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 8, in <module>
    load_entry_point('virtualenv==1.7', 'console_scripts', 'virtualenv')()
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 928, in main
    never_download=options.never_download)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1029, in create_environment
    site_packages=site_packages, clear=clear))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1296, in install_python
    py_executable])
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1006, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python @executable_path/../.Python pyramidenv/bin/python failed with error code 1

But, the problem solved after I manually reinstalled the Xcode.

@macdhuibh

This comment has been minimized.

Show comment Hide comment
@macdhuibh

macdhuibh Jan 4, 2012

Although I have XCode installed and at one time virtualenv was working fine, it is no longer.
MacOS 10.6.6, MacPorts installed Python2.7. I have the same traceback as aidanlister.
My latest attempt was with a pip installed virtualenv 1.7.

Although I have XCode installed and at one time virtualenv was working fine, it is no longer.
MacOS 10.6.6, MacPorts installed Python2.7. I have the same traceback as aidanlister.
My latest attempt was with a pip installed virtualenv 1.7.

@macdhuibh

This comment has been minimized.

Show comment Hide comment
@macdhuibh

macdhuibh Jan 4, 2012

After a little digging around I came across @gregglind's fork and feature/install_name_tool branch
https://github.com/gregglind/virtualenv/tree/feature/install_name_tool

I did the following and now virtualenv seems to be working just fine. YMMV

git clone https://github.com/gregglind/virtualenv.git
cd virtualenv
git checkout feature/install_name_tool
sudo python setup.py install

After a little digging around I came across @gregglind's fork and feature/install_name_tool branch
https://github.com/gregglind/virtualenv/tree/feature/install_name_tool

I did the following and now virtualenv seems to be working just fine. YMMV

git clone https://github.com/gregglind/virtualenv.git
cd virtualenv
git checkout feature/install_name_tool
sudo python setup.py install
@stancarney

This comment has been minimized.

Show comment Hide comment
@stancarney

stancarney Mar 15, 2012

I had the same issue on Lion. Xcode was installed via the App Store but install_name_tool wasn't available until I downloaded and installed command_line_tools_for_xcode.dmg from developer.apple.com. All works well now.

I had the same issue on Lion. Xcode was installed via the App Store but install_name_tool wasn't available until I downloaded and installed command_line_tools_for_xcode.dmg from developer.apple.com. All works well now.

@gorakhargosh

This comment has been minimized.

Show comment Hide comment
@gorakhargosh

gorakhargosh Mar 17, 2012

@stancarney
Can you provide a link to that?

@stancarney
Can you provide a link to that?

@stancarney

This comment has been minimized.

Show comment Hide comment
@stancarney

stancarney Mar 17, 2012

@gorakhargosh
I can't link right to it because you have to login to developer.apple.com with your Apple Id, but if you hit this URL and login the command line tools dmg for March is second from the top. https://developer.apple.com/downloads/index.action.

@gorakhargosh
I can't link right to it because you have to login to developer.apple.com with your Apple Id, but if you hit this URL and login the command line tools dmg for March is second from the top. https://developer.apple.com/downloads/index.action.

@leetrout

This comment has been minimized.

Show comment Hide comment
@leetrout

leetrout Apr 4, 2012

@stancarney +1 Great tip- Thank you!

I just upgraded from 10.6.8 to 10.7.3 and had the same install_name_tool error and installing the command line tools fixed it.

leetrout commented Apr 4, 2012

@stancarney +1 Great tip- Thank you!

I just upgraded from 10.6.8 to 10.7.3 and had the same install_name_tool error and installing the command line tools fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment