Virtualenv bug breaking tox runs
I'm trying to use tox from python2 to test a python3 environment. But I get an exception like the following:
rsyring@loftex:~/projects/blaze/blazeutils-src$ python -m virtualenv --python python3 ~/tmp/testvenv Running virtualenv with interpreter /home/rsyring/bin/python3 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 14, in <module> import shutil File "/opt/python34/lib/python3.4/shutil.py", line 11, in <module> import fnmatch File "/opt/python34/lib/python3.4/fnmatch.py", line 15, in <module> import functools File "/opt/python34/lib/python3.4/functools.py", line 21, in <module> from collections import namedtuple File "/opt/python34/lib/python3.4/collections/__init__.py", line 17, in <module> from reprlib import recursive_repr as _recursive_repr File "/usr/local/lib/python2.7/dist-packages/reprlib.py", line 3, in <module> from repr import * ImportError: No module named 'repr'
There is a bug for this in virtualenv: https://github.com/pypa/virtualenv/issues/625 So, I realize I could use `python3 -m virtualenv` if I was running the command myself. But, tox is making the call to virtualenv. This was working the last time I tested it but has now broken. I'm guessing that is because I upgraded tox or virtualenv? Any pointers welcome as to the best way to resolve this issue now? Thanks in advance. *Randy Syring* Husband | Father | Redeemed Sinner /"For what does it profit a man to gain the whole world and forfeit his soul?" (Mark 8:36 ESV)/
On Wed, Jul 15, 2015 at 12:55:50AM -0400, Randy Syring wrote:
I'm trying to use tox from python2 to test a python3 environment. But I get an exception like the following:
rsyring@loftex:~/projects/blaze/blazeutils-src$ python -m virtualenv --python python3 ~/tmp/testvenv Running virtualenv with interpreter /home/rsyring/bin/python3 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 14, in <module> import shutil File "/opt/python34/lib/python3.4/shutil.py", line 11, in <module> import fnmatch File "/opt/python34/lib/python3.4/fnmatch.py", line 15, in <module> import functools File "/opt/python34/lib/python3.4/functools.py", line 21, in <module> from collections import namedtuple File "/opt/python34/lib/python3.4/collections/__init__.py", line 17, in <module> from reprlib import recursive_repr as _recursive_repr File "/usr/local/lib/python2.7/dist-packages/reprlib.py", line 3, in <module> from repr import * ImportError: No module named 'repr'
There is a bug for this in virtualenv:
https://github.com/pypa/virtualenv/issues/625
So, I realize I could use `python3 -m virtualenv` if I was running the command myself. But, tox is making the call to virtualenv.
This was working the last time I tested it but has now broken. I'm guessing that is because I upgraded tox or virtualenv?
It broke now because you 'sudo pip install'ed something that depends on something that ships /usr/local/lib/python2.7/dist-packages/reprlib.py (which probably comes from pies2overrides)
Any pointers welcome as to the best way to resolve this issue now?
I would recommend sudo pip uninstall pies2overrides (and whatever depended on it). A good way to avoid pain is to never ever 'sudo pip install' stuff. A different workaround would be to create a clean virtualenv, install tox into it, then run tox from that virtualenv. Marius Gedminas -- Un*x admins know what they are doing by definition. -- Bernd Petrovitsch
You could try using the virtualenv rewrite (my branch) - it's well tested,
albeit unreviewed. AFAIK it doesn't have the issue you've hit.
Just run: pip install
https://github.com/ionelmc/virtualenv/archive/develop.zip
Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro
On Wed, Jul 15, 2015 at 9:08 AM, Marius Gedminas
On Wed, Jul 15, 2015 at 12:55:50AM -0400, Randy Syring wrote:
I'm trying to use tox from python2 to test a python3 environment. But I get an exception like the following:
rsyring@loftex:~/projects/blaze/blazeutils-src$ python -m virtualenv --python python3 ~/tmp/testvenv Running virtualenv with interpreter /home/rsyring/bin/python3 Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 14, in <module> import shutil File "/opt/python34/lib/python3.4/shutil.py", line 11, in <module> import fnmatch File "/opt/python34/lib/python3.4/fnmatch.py", line 15, in <module> import functools File "/opt/python34/lib/python3.4/functools.py", line 21, in <module> from collections import namedtuple File "/opt/python34/lib/python3.4/collections/__init__.py", line 17, in <module> from reprlib import recursive_repr as _recursive_repr File "/usr/local/lib/python2.7/dist-packages/reprlib.py", line 3, in <module> from repr import * ImportError: No module named 'repr'
There is a bug for this in virtualenv:
https://github.com/pypa/virtualenv/issues/625
So, I realize I could use `python3 -m virtualenv` if I was running the command myself. But, tox is making the call to virtualenv.
This was working the last time I tested it but has now broken. I'm guessing that is because I upgraded tox or virtualenv?
It broke now because you 'sudo pip install'ed something that depends on something that ships /usr/local/lib/python2.7/dist-packages/reprlib.py (which probably comes from pies2overrides)
Any pointers welcome as to the best way to resolve this issue now?
I would recommend sudo pip uninstall pies2overrides (and whatever depended on it). A good way to avoid pain is to never ever 'sudo pip install' stuff.
A different workaround would be to create a clean virtualenv, install tox into it, then run tox from that virtualenv.
Marius Gedminas -- Un*x admins know what they are doing by definition. -- Bernd Petrovitsch
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
On 07/15/2015 02:08 AM, Marius Gedminas wrote:
So, I realize I could use `python3 -m virtualenv` if I was running the command myself. But, tox is making the call to virtualenv.
This was working the last time I tested it but has now broken. I'm guessing that is because I upgraded tox or virtualenv? It broke now because you 'sudo pip install'ed something that depends on something that ships /usr/local/lib/python2.7/dist-packages/reprlib.py (which probably comes from pies2overrides)
Any pointers welcome as to the best way to resolve this issue now? I would recommend sudo pip uninstall pies2overrides (and whatever depended on it). A good way to avoid pain is to never ever 'sudo pip install' stuff.
A different workaround would be to create a clean virtualenv, install tox into it, then run tox from that virtualenv.
Thanks so much, that was exactly the problem. I've always had my system setup to have a few default packages installed globally and then use virtualenvs for everything else. Not sure where pie2overrides came from, but I can assure you it's getting booted ASAP! *Randy Syring* Husband | Father | Redeemed Sinner /"For what does it profit a man to gain the whole world and forfeit his soul?" (Mark 8:36 ESV)/
participants (3)
-
Ionel Cristian Mărieș
-
Marius Gedminas
-
Randy Syring