conda-auto-env | Automatically activate a conda environment | Reinforcement Learning library
kandi X-RAY | conda-auto-env Summary
kandi X-RAY | conda-auto-env Summary
Automatically activate a conda environment when entering a folder with an environment.yml file
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of conda-auto-env
conda-auto-env Key Features
conda-auto-env Examples and Code Snippets
Community Discussions
Trending Discussions on conda-auto-env
QUESTION
Is this possible? With virtualenv I used to use virtualfish, but there doesn't seem to be a conda equivalent. For bash I've found https://github.com/chdoig/conda-auto-env which also references https://github.com/sotte/conda_auto_activate.
Alternatively, a fish plugin which automatically runs when in a particular directory would work just about as well.
...ANSWER
Answered 2019-May-07 at 16:58It should be possible. Inspired by this line in the fish documentation (emphasis mine):
Autoloading Functions
When fish encounters a command, it attempts to autoload a function for that command, by looking for a file with the name of that command in ~/.config/fish/functions/.
So we can have a function that checks the folder on every 'cd' command and run the script to activate where appropriate. Easier to do it if you have only one VE.
May be the solution is to check for a certain script file that switches the VE in the new directory and execute it if it exists. (That has to take care of how to handle the case where you switch directly to a subdirectory.)
Updated after a counter question from the OP: Here is what I had in mind. Say we copy this function to a file called ~/.config/fish/functions/cd.fish:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install conda-auto-env
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page