Search code examples
pythonpipenthoughtcanopy

Installing packages within canopy venv


I am looking into using Canopy Express as an IDE. My understanding is that it uses a backport of venv from Python 3 to manage user-generated virtual environments, in addition to being a virtual environment unto itself. I just want to verify that within any virtual environments I create in Canopy, I will be able to install project-specific packages not included in the Express distribution using easy_install/pip as described here. That last link doesn't explicitly say that such package management works in a user-created virtual environment, hence my uncertainty.

Put simply, what I want is (assuming all my projects are 2.7-based) to install Canopy Express once and use it as my default Python. Then for various projects requiring packages that Express doesn't include, I can create separate virtual environments and install such packages on an as-needed basis.

If I can't do this, the other alternative I see is to install Canopy Express in virtualenv environments on an as-needed basis, and then to use those environment's pips to install extra packages.

Any thoughts?


Solution

  • Yes, you just need to install setuptools and pip into your venv. If you use the -s/--system-site-packages option, you can inherit these from Canopy's installation (you may need to manually install the pip package using the package manager before making your venv). Appropriately-modified copies of the easy_install and pip scripts will be installed into your venv and will install into your venv's site-packages.