Issues with virtual environments (venv) in Canopy 1.2 and 1.3

In Canopy 1.2 and 1.3, there are several issues with virtual environments created with the Canopy CLI. These issues should be fixed in Canopy 1.4.

Virtual Environments with inherited packages

A virtual environment created with canopy_cli venv -s should inherit from all of its ancestor virtual environments--the environment from which it was created, and the base Canopy Core environment, and everything in between. However at present this is only true for children of the Canopy User Python environment, not for its grandchildren. 

If you need to create two generations of virtual environment under Canopy User Python, use the venv -s command, not canopy_cli venv -s.

Bare (empty) virtual environments

A bare virtual environment (created with canopy_cli venv, no "-s" option), does not include the enpkg or egginst utilities (from the enstaller package). This makes it difficult to install packages from the Canopy repository.

If you wish to use enpkg for this purpose, you should follow these steps:

  1. Create your virtual environment: While the Canopy User Python is active, run canopy_cli venv test-venv to create the bare venv.
  2. Then while User is still active run enpkg --prefix test-venv enstaller to use the User enstaller to bootstrap/install enstaller into the venv.
  3. Finally, the user can then activate the venv and run enpkg there to install the desired packages and their dependencies.

WARNING: If you are prompted to update enstaller, don't! There is a small bug introduced in the latest enstaller egg (version 4.6.3-1) that will be remedied by a soon to come package update. If you've already updated enstaller, you'll notice that it will not let you complete step 2 from above. The workaround is to downgrade the User environment's enpkg using the command: enpkg enstaller-4.6.2-1 and proceed as usual.

Have more questions? Submit a request

Comments

Powered by Zendesk