Anaconda and VirtualEnv

17,267

It doesn't really make sense to merge Anaconda and a virtualenv, as Anaconda is a completely independent installation of Python. You can do it, typically by setting your PYTHONPATH, but things have a good chance of breaking when you do this sort of thing, and I would recommend against it.

If there are libraries in your virtualenv, you can use them with Anaconda by making conda packages for them. They may already have conda packages (search with conda search and search https://binstar.org/). Otherwise, you can build a package using a conda recipe. See http://conda.pydata.org/docs/build.html and https://github.com/conda/conda-recipes for some example recipes.

Share:
17,267
melchoir55
Author by

melchoir55

Natural Language Processing, C#, Java, Drools, OpenRemote/Home Automation, Object Oriented Design/Development, Python

Updated on June 04, 2022

Comments

  • melchoir55
    melchoir55 almost 2 years

    I have a virtualenv running python 2.7.7. It has a pretty extensive set of libraries which support a pretty complicated set of proprietary modules. In other words, the virtualenv needs to maintain its integrity. That is of course the whole point of virtualenv.

    Recently, I encountered a number of problems that are very easily solved by using Anaconda. I tried it out in a test environment and it worked quite well. Now I'm tasked with incorporating this new configuration into production. It isn't clear to me how to incorporate Anaconda into a virtualenv, or whether this is even a good idea. In fact, it almost seems to me like I should use the anaconda install as the new source and desconstruct the old virtualenv... merging the libraries it held into the conda.

    Does anyone have a recommendation as to the best approach? If merging the environments is called for, can anyone point to an explanation of how to go about it?

  • melchoir55
    melchoir55 over 9 years
    I was suggesting that anaconda and virtualenv merge. I was suggesting merging the proprietary libraries once held in the virtualenv into anaconda, then throwing the virtualenv away. I don't understand what the point of making conda packages is. The libraries are already standard python modules. Can one not just simply drop in python modules?
  • asmeurer
    asmeurer over 9 years
    The advantage of making conda packages is that you can track them with conda. It's not a requirement, it just makes things easier in the long run.