1

I have just started using virtualenv from this tutorial, where it uses yolk to list the packages installed in the virtualenv, but yolk by default is for Python 2, so I decided to upgrade with an extension for Python 3, my current version, with the following command:

pip3 install --upgrade yolk3k

It works when I am not in the virtualenv that I called virt0, but if I am on it, it gives me the error it was giving me before upgrading it to the Python 3 version.

    print " %s %s (%s)" % (project_name, dist.version,
                      ^
SyntaxError: invalid syntax

When I tried to install yolk in the virt0, the output was the following:

Searching for yolk
Best match: yolk 0.4.3
Processing yolk-0.4.3-py3.4.egg
yolk 0.4.3 is already the active version in easy-install.pth
Installing yolk script to /Users/user/Desktop/virt_env/virt0/bin

Using /Users/user/Desktop/virt_env/virt0/lib/python3.4/site-packages/yolk-0.4.3-py3.4.egg
Processing dependencies for yolk
Finished processing dependencies for yolk

In /Users/user/Desktop/virt_env/virt0/bin, I have this:

activate            pip3
activate.csh        pip3.4
activate.fish       python
activate_this.py    python3
easy_install        python3.4
easy_install-3.4    yolk
pip

which confirms that yolk was installed, but how can I update it also to yolk3k in virt0?

If I try to install yolk3k with the following command:

pip3 install --upgrade yolk3k

inside /Users/user/Desktop/virt_env/virt0/bin, it outputs:

Requirement already up-to-date: yolk3k in /Users/user/Desktop/virt_env/virt0/lib/python3.4/site-packages

but it still gives me the error I cited above.

nbro
  • 15,395
  • 32
  • 113
  • 196
  • Has the virtual environment been activated? – thefourtheye Jan 11 '15 at 11:30
  • @thefourtheye Yes, I have activated... and actually that is the actual problem, where I am on the vitualenv `virt0` :D – nbro Jan 11 '15 at 11:32
  • Can you please show the actual list of commands you executed and their outputs? – thefourtheye Jan 11 '15 at 11:33
  • Please include all these information in the question itself. – thefourtheye Jan 11 '15 at 11:51
  • @thefourtheye Fortunately, apparently, I can list the installed packages in the _virtualenv_ `virt0` using the normal _pip3_ with the following command: `pip3 list`, if you someone could help me also with `yolk`, it would be great. – nbro Jan 11 '15 at 12:20

1 Answers1

2

Delete the virtualenv, recreate it with Python 3 as the interpreter and install all dependencies for Python 3 (such as yolk3k). The problem seems to come from the fact that you're going from a 2.x to a 3.x environment even though the virtualenv originally wasn't.

That's not the intended way of using a virtualenv - a virtualenv should be tied to one particular Python version (e.g., 2.7 or 3.4) with all dependencies installed for that version. So you should throw away the virtualenv and rebuild it entirely using 3.x dependencies. That should resolve any conflicting language issues.

Simeon Visser
  • 118,920
  • 18
  • 185
  • 180