virtualenv doesn't notice when installing distribute fails #301

Closed
hukka opened this Issue Jul 10, 2012 · 4 comments

Comments

Projects
None yet
5 participants

hukka commented Jul 10, 2012

Trying to create a new virtualenv outputs

New python executable in my_new_env3.2/bin/python3.2
Also creating executable in my_new_env3.2/bin/python
Installing distribute......................................................................................................done.
Installing pip....
  Complete output from command /home/tpievila/work/...env3.2/bin/python3.2 -x /home/tpievila/work/...3.2/bin/easy_install pip:
  /home/tpievila/work/pas/my_new_env3.2/bin/python3.2: can't open file '/home/tpievila/work/pas/my_new_env3.2/bin/easy_install': [Errno 2] No such file or directory
----------------------------------------
...Installing pip...done.
Traceback (most recent call last):
  File "virtualenv.py", line 2429, in <module>
    main()
  File "virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "virtualenv.py", line 1054, in create_environment
    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
  File "virtualenv.py", line 654, in install_pip
    filter_stdout=_filter_setup)
  File "virtualenv.py", line 1020, in call_subprocess
    % (cmd_desc, proc.returncode))
OSError: Command /home/tpievila/work/...env3.2/bin/python3.2 -x /home/tpievila/work/...3.2/bin/easy_install pip failed with error code 2

Only when -vvv is activated, the output shows (irrelevant parts snipped):

Traceback (most recent call last):
    File "setup.py", line 25, in <module>
      from lib2to3.main import main
    File "/usr/local/lib/python3.2/lib2to3/main.py", line 14, in <module>
      from . import refactor
    File "/usr/local/lib/python3.2/lib2to3/refactor.py", line 27, in <module>
      from .fixer_util import find_root
    File "/usr/local/lib/python3.2/lib2to3/fixer_util.py", line 9, in <module>
      from .pygram import python_symbols as syms
    File "/usr/local/lib/python3.2/lib2to3/pygram.py", line 32, in <module>
      python_grammar = driver.load_grammar(_GRAMMAR_FILE)
    File "/usr/local/lib/python3.2/lib2to3/pgen2/driver.py", line 130, in load_grammar
      g.load(gp)
    File "/usr/local/lib/python3.2/lib2to3/pgen2/grammar.py", line 95, in load
      f = open(filename, "rb")
  IOError: [Errno 13] Permission denied: '/usr/local/lib/python3.2/lib2to3/Grammar3.2.3.final.0.pickle'
  Something went wrong during the installation.
  See the error message above.
...Installing distribute...done.

so actually distribute install is NOT done. Virtualenv should notice this and abort the installation at that point, reducing time to debug the situation.

Contributor

carljm commented Jul 10, 2012

Yes, certainly - pull request welcome.

Contributor

g2p commented Oct 14, 2012

I have a local fix to virtualenv_embedded/distribute_setup.py , but I've sent it to distribute first since it's the upstream for that file: https://bitbucket.org/tarek/distribute/pull-request/23/

Once distribute is updated, it will be a matter of running bin/refresh-support-files.py and bin/rebuild-script.py to update virtualenv.

Contributor

g2p commented Oct 19, 2012

So, it's been merged in the development version of distribute. I don't know about their release timeline.

FYI, distribute 0.6.29 has been released including your fix.

pnasrat closed this in 5e09944 Oct 24, 2012

@jperkin jperkin pushed a commit to joyent/pkgsrc that referenced this issue Dec 9, 2013

wiz Update to 0.6.29:
------
0.6.29
------

* Pull Request #14: Honor file permissions in zip files.
* Issue #327: Merged pull request #24 to fix a dependency problem with pip.
* Merged pull request #23 to fix pypa/virtualenv#301.
* If Sphinx is installed, the `upload_docs` command now runs `build_sphinx`
  to produce uploadable documentation.
* Issue #326: `upload_docs` provided mangled auth credentials under Python 3.
* Issue #320: Fix check for "createable" in distribute_setup.py.
* Issue #305: Remove a warning that was triggered during normal operations.
* Issue #311: Print metadata in UTF-8 independent of platform.
* Issue #303: Read manifest file with UTF-8 encoding under Python 3.
* Issue #301: Allow to run tests of namespace packages when using 2to3.
* Issue #304: Prevent import loop in site.py under Python 3.3.
* Issue #283: Reenable scanning of *.pyc / *.pyo files on Python 3.3.
* Issue #299: The develop command didn't work on Python 3, when using 2to3,
  as the egg link would go to the Python 2 source. Linking to the 2to3'd code
  in build/lib makes it work, although you will have to rebuild the module
  before testing it.
* Issue #306: Even if 2to3 is used, we build in-place under Python 2.
* Issue #307: Prints the full path when .svn/entries is broken.
* Issue #313: Support for sdist subcommands (Python 2.7)
* Issue #314: test_local_index() would fail an OS X.
* Issue #310: Non-ascii characters in a namespace __init__.py causes errors.
* Issue #218: Improved documentation on behavior of `package_data` and
  `include_package_data`. Files indicated by `package_data` are now included
  in the manifest.
* `distribute_setup.py` now allows a `--download-base` argument for retrieving
  distribute from a specified location.
93ddf1c

@jsonn jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Oct 11, 2014

wiz Update to 0.6.29:
------
0.6.29
------

* Pull Request #14: Honor file permissions in zip files.
* Issue #327: Merged pull request #24 to fix a dependency problem with pip.
* Merged pull request #23 to fix pypa/virtualenv#301.
* If Sphinx is installed, the `upload_docs` command now runs `build_sphinx`
  to produce uploadable documentation.
* Issue #326: `upload_docs` provided mangled auth credentials under Python 3.
* Issue #320: Fix check for "createable" in distribute_setup.py.
* Issue #305: Remove a warning that was triggered during normal operations.
* Issue #311: Print metadata in UTF-8 independent of platform.
* Issue #303: Read manifest file with UTF-8 encoding under Python 3.
* Issue #301: Allow to run tests of namespace packages when using 2to3.
* Issue #304: Prevent import loop in site.py under Python 3.3.
* Issue #283: Reenable scanning of *.pyc / *.pyo files on Python 3.3.
* Issue #299: The develop command didn't work on Python 3, when using 2to3,
  as the egg link would go to the Python 2 source. Linking to the 2to3'd code
  in build/lib makes it work, although you will have to rebuild the module
  before testing it.
* Issue #306: Even if 2to3 is used, we build in-place under Python 2.
* Issue #307: Prints the full path when .svn/entries is broken.
* Issue #313: Support for sdist subcommands (Python 2.7)
* Issue #314: test_local_index() would fail an OS X.
* Issue #310: Non-ascii characters in a namespace __init__.py causes errors.
* Issue #218: Improved documentation on behavior of `package_data` and
  `include_package_data`. Files indicated by `package_data` are now included
  in the manifest.
* `distribute_setup.py` now allows a `--download-base` argument for retrieving
  distribute from a specified location.
7e59d3e

This was referenced Jul 17, 2016

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