paylogic / pip-accel

pip-accel: Accelerator for pip, the Python package manager
https://pypi.python.org/pypi/pip-accel
MIT License
308 stars 35 forks source link

py.test in python 2.6 environment doesn't install correctly #10

Closed hvdklauw closed 11 years ago

hvdklauw commented 11 years ago

Steps:

  1. Make sure pip-accel cache contains no pytest
  2. mkvirtualenv test -ppython2.6
  3. workon test
  4. pip-accel install pytest==2.3.5
  5. py.test
Traceback (most recent call last):
  File "/home/harrovanderklauw/virtualenvs/test/bin/py.test", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 2815, in <module>
    working_set.require(__requires__)
  File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 690, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 588, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pytest==2.3.5
zsh: exit 1     py.test

Traceback (most recent call last): File "/home/harrovanderklauw/virtualenvs/test/bin/py.test", line 5, in from pkg_resources import load_entry_point File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 2815, in working_set.require(requires) File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 690, in require needed = self.resolve(parse_requirements(requirements)) File "/home/harrovanderklauw/virtualenvs/test/lib/python2.6/site-packages/distribute-0.6.28-py2.6.egg/pkg_resources.py", line 588, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: pytest==2.3.5 zsh: exit 1 py.test

hvdklauw commented 11 years ago
(pip-accel) Installing from binary distributions ..
(pip-accel) Installing binary distribution /home/harrovanderklauw/.pip-accel/binaries/pytest:2.3.5.tar.gz to /home/harrovanderklauw/virtualenvs/test ..
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/bin/py.test-2.7
(pip-accel) Hashbang '#!/home/harrovanderklauw/virtualenvs/paylogic/bin/python' looks like a Python hashbang! We'll rewrite it!
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/bin/py.test
(pip-accel) Hashbang '#!/home/harrovanderklauw/virtualenvs/paylogic/bin/python' looks like a Python hashbang! We'll rewrite it!
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/requires.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/dependency_links.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/entry_points.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/SOURCES.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/top_level.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/not-zip-safe
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest-2.3.5-py2.7.egg-info/PKG-INFO
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/pytest.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/standalonetemplate.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/genscript.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/runner.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/python.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/tmpdir.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/resultlog.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/pastebin.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/recwarn.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/pytester.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/core.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/terminal.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/helpconfig.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/hookspec.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/capture.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/nose.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/doctest.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/main.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/rewrite.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/oldinterpret.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/util.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/newinterpret.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/assertion/reinterpret.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/unittest.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/pdb.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/skipping.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/junitxml.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/mark.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/config.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/_pytest/monkeypatch.py
(pip-accel) Finished installing binary distribution in 0.03 seconds.
(pip-accel) Installing binary distribution /home/harrovanderklauw/.pip-accel/binaries/py:1.4.14.tar.gz to /home/harrovanderklauw/virtualenvs/test ..
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info/dependency_links.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info/SOURCES.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info/top_level.txt
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info/not-zip-safe
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py-1.4.14-py2.7.egg-info/PKG-INFO
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_builtin.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_log
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_log/log.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_log/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_log/warning.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/__metainfo.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_error.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_apipkg.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/test.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_iniconfig.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/svnwc.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/common.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/svnurl.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/cacheutil.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_path/local.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_process
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_process/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_process/forkedfunc.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_process/killproc.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_process/cmdexec.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/_assertionold.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/code.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/_assertionnew.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/assertion.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_code/source.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_xmlgen.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_std.py
(pip-accel) Creating directory: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_io
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_io/terminalwriter.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_io/__init__.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_io/capture.py
(pip-accel) Writing file: /home/harrovanderklauw/virtualenvs/test/lib/python2.7/site-packages/py/_io/saferepr.py
(pip-accel) Finished installing binary distribution in 0.01 seconds.
(pip-accel) Finished installing all requirements in 0.08 seconds.
(pip-accel) Done! Took 0.71 seconds to install 2 packages.

So, I use a globally installed pip-accel (which respects my virtualenv), but does not appear to respect my python version for that environment when installing :D

hvdklauw commented 11 years ago

Ok, installing pip-accel in the virtualenv will actually negate this problem, it is however strange that pip-accel respects the virtualenv but not the python version.

Maybe the better solution would be to actually error out of pip-accel when you are trying to run it when you are in a virtualenv but pip-accel is not installed inside that virtualenv.

xolox commented 11 years ago

Just discussed this with Harro IRL and I agree a clear error message is the best way. It's also fairly trivial to implement. Most work will actually go into explaining this in the documentation :-). Will update this issue soon.

xolox commented 11 years ago

One addition: This is a nasty problem indeed, I ran into it as well and it confused the hell out of me at first :-]. Pip doesn't have this problem because virtualenv copies pip into newly created virtual environments (so theoretically pip has the same problem, but in practice no one will ever notice).

xolox commented 11 years ago

This is now fixed, in the sense that starting from version 0.8.16 pip-accel will flat out refuse to install in a prefix which is different from its own installation prefix. I hope I made the error message clear enough:

2013-06-15 19:44:35 wheezy-vm ERROR You are trying to install in prefix #1 which is different from prefix #2 where pip-accel is installed! Please install pip-accel under the other prefix to install packages there.
2013-06-15 19:44:35 wheezy-vm INFO Prefix #1: /home/peter/.virtualenvs/init (the environment prefix)
2013-06-15 19:44:35 wheezy-vm INFO Prefix #2: /home/peter/.virtualenvs/pip-accel (the installation prefix)

Thanks for the feedback!