Issue #168 resolved

easy_install fails with byte-compiling disabled

Carl Meyer
created an issue

Over in #pip we've seen several bug-reports now from people trying to create virtualenvs when they have disabled Python byte-compiling (PYTHONDONTWRITEBYTECODE=1). It looks like it's an easy_install problem (virtualenv uses easy_install to bootstrap pip into the virtualenv):

{{{

!shell

~/tmp$ virtualenv --version 1.4.9 ~/tmp$ pip --version pip 0.7.2 from /usr/local/lib/python2.6/dist-packages/pip-0.7.2-py2.6.egg (python 2.6) ~/tmp$ pip -E piptest install Creating new virtualenv environment in piptest New python executable in piptest/bin/python Installing setuptools...done..... Complete output from command /home/dan/tmp/piptest/bin/python /home/dan/tmp/piptest/bin/easy_install /usr/local/lib/python2.6/dist-...ar.gz: Processing pip-0.7.2.tar.gz Running pip-0.7.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-pg8CgV/pip-0.7.2/egg-dist-tmp-Rslilb warning: no files found matching '.html' under directory 'docs' warning: no previously-included files matching '.txt' found under directory 'docs/_build' no previously-included directories found matching 'docs/_build/_sources' warning: build_py: byte-compiling is disabled, skipping. warning: install_lib: byte-compiling is disabled, skipping. error: byte-compiling is disabled.


Traceback (most recent call last): File "/usr/local/bin/pip", line 9, in <module> load_entry_point('pip==0.7.2', 'console_scripts', 'pip')() File "/usr/local/lib/python2.6/dist-packages/pip-0.7.2-py2.6.egg/pip/init.py", line 94, in main return command.main(initial_args, args[1:], options) File "/usr/local/lib/python2.6/dist-packages/pip-0.7.2-py2.6.egg/pip/basecommand.py", line 103, in main complete_args) File "/usr/local/lib/python2.6/dist-packages/pip-0.7.2-py2.6.egg/pip/venv.py", line 33, in restart_in_venv virtualenv.create_environment(venv, site_packages=site_packages) File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.4.9-py2.6.egg/virtualenv.py", line 618, in create_environment install_pip(py_executable) File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.4.9-py2.6.egg/virtualenv.py", line 390, in install_pip filter_stdout=_filter_setup) File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.4.9-py2.6.egg/virtualenv.py", line 587, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command /home/dan/tmp/piptest/bin/python /home/dan/tmp/piptest/bin/easy_install /usr/local/lib/python2.6/dist-...ar.gz failed with error code 1 }}}

Comments (7)

  1. Carl Meyer reporter

    Unfortunately I was never able to duplicate this myself, and I don't know why. After we got the third or fourth report of it in #pip I thought it was worth reporting here, but I can't verify the fix. Given that (and that the fix for #147 certainly looks promising to fix this), closing this pending any further reports in the wild.

  2. Collin Anderson

    I'm running into the same problem, and I'd rather not use the workaround. I am able to reproduce the problem, so if someone can give me a strategy to debug this, that would be great. I don't know how I would detect where byte_compile() is called.

    ~$ /home/collin/virtenv/bin/python2.6 /home/collin/virtenv/bin/easy_install ./pip-0.8.2.tar.gz
    Processing pip-0.8.2.tar.gz
    Running pip-0.8.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-E0tlz4/pip-0.8.2/egg-dist-tmp-KXHHnB
    warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
    no previously-included directories found matching 'docs/_build/_sources'
    warning: build_py: byte-compiling is disabled, skipping.
    warning: install_lib: byte-compiling is disabled, skipping.
    error: byte-compiling is disabled.
    
    
  3. Collin Anderson

    Here's a full traceback to the function call. Is this a problem with virtualenv instead?

    ~$ virtualenv-2.6 virtenv
    New python executable in virtenv/bin/python2.6
    Not overwriting existing python script virtenv/bin/python (you must use virtenv/bin/python2.6)
    Installing setuptools.............done.
      Complete output from command /home/collin/virtenv/bin/python2.6 /home/collin/virtenv/bin/easy_install ./pip-0.8.2.tar.gz:
      Processing pip-0.8.2.tar.gz
    Running pip-0.8.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-d4IDuJ/pip-0.8.2/egg-dist-tmp-2ymIKC
    warning: no previously-included files matching '*.txt' found under directory 'docs/_build'
    no previously-included directories found matching 'docs/_build/_sources'
    warning: build_py: byte-compiling is disabled, skipping.
    warning: install_lib: byte-compiling is disabled, skipping.
    Traceback (most recent call last):
      File "/home/collin/virtenv/bin/easy_install", line 8, in <module>
        load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1712, in main
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
    
      File "/opt/lib/py26/lib/python2.6/distutils/core.py", line 152, in setup
        dist.run_commands()
      File "/opt/lib/py26/lib/python2.6/distutils/dist.py", line 975, in run_commands
        self.run_command(cmd)
      File "/opt/lib/py26/lib/python2.6/distutils/dist.py", line 995, in run_command
        cmd_obj.run()
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 211, in run
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 427, in easy_install
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 476, in install_item
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 655, in install_eggs
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 935, in build_and_install
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 693, in install_egg
    
      File "/opt/lib/py26/lib/python2.6/distutils/cmd.py", line 358, in execute
        util.execute(func, args, msg, dry_run=self.dry_run)
      File "/opt/lib/py26/lib/python2.6/distutils/util.py", line 408, in execute
        func(*args)
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 997, in unpack_and_compile
    
      File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py", line 1009, in byte_compile
    
      File "/opt/lib/py26/lib/python2.6/distutils/util.py", line 462, in byte_compile
        assert False
    AssertionError
    ----------------------------------------
    Traceback (most recent call last):
      File "/usr/local/bin/virtualenv-2.6", line 9, in <module>
        load_entry_point('virtualenv==1.5.1', 'console_scripts', 'virtualenv')()
      File "/opt/lib/py26/lib/python2.6/site-packages/virtualenv.py", line 558, in main
        prompt=options.prompt)
      File "/opt/lib/py26/lib/python2.6/site-packages/virtualenv.py", line 656, in create_environment
        install_pip(py_executable)
      File "/opt/lib/py26/lib/python2.6/site-packages/virtualenv.py", line 415, in install_pip
        filter_stdout=_filter_setup)
      File "/opt/lib/py26/lib/python2.6/site-packages/virtualenv.py", line 624, in call_subprocess
        % (cmd_desc, proc.returncode))
    OSError: Command /home/collin/virtenv/bin/python2.6 /home/collin/virtenv/bin/easy_install ./pip-0.8.2.tar.gz failed with error code 1
    
  4. Log in to comment