Create a message to activate the script in Conda

I am building a Django web application and using Conda to manage the required packages and virtual environment. I want to set an environment variable (location of Django settings) as soon as I activate the environment. It should also change the current directory to my project directory.

I previously used virtualenvwrapper and I just added commands to the postactivate script.

How can I achieve this with Conda?

+3
source share
1 answer

This feature is available with conda v3.8 (after this question was asked). Any files *.shhosted in ${CONDA_PREFIX}/etc/conda/activate.d/will be received upon activation of the environment.

Docs: https://conda.io/docs/user-guide/tasks/manage-environments.html#saving-environment-variables

: https://groups.google.com/a/continuum.io/d/msg/anaconda/sQJQ7DBwpfI/pP4_Esbl6VYJ

+4

Source: https://habr.com/ru/post/1687783/


All Articles