I think it should be trivial to write a portable script to do all those and bind it to conda env rename old new. #!/home/tgowda/miniconda3/envs/unsup/bin/python $ head -1 $(which jupyter) # check if updated So, we can easily fix it with a sed $ sed -i.bak "s:envs/$OLD/bin:envs/$NEW/bin:" $NEW/bin/* If you wish to add a new package to your environment file, you can do so by updating the environment.yml file. #!/home/tgowda/miniconda3/envs/rtg/bin/python Open ‘anaconda’ prompt window from the start bar and run the following command. $ head -1 $(which jupyter) # its hashbang is still looking at old Creating the machine learning anaconda environment Lets first create an environment with a name MLenv. home/tgowda/miniconda3/envs/unsup/bin/jupyter See jupyter, for example: $ which jupyter The pending task is, $NEW/bin dir has a bunch of executable scripts with hashbangs ( #!) pointing to the $OLD env paths. Open anaconda prompt & use conda env list to find the location of the environment you wish to use. Upload it to either using the web interface or the anaconda upload command. The previous answer reported upto this, but wait, we are not done yet! Open the Terminal or an Anaconda Prompt and enter: conda env export -n my-environment -f my-environment.yml NOTE: Replace my-environment with the actual name of your environment. home/tgowda/miniconda3/envs/unsup/bin/python Set up Anaconda Create a virtual environment and install the dependencies. Here I am trying to rename rtg -> unsup (please bear with those names, this is my real use case) $ cd /home/tgowda/miniconda3/envs Type Anaconda prompt in the search bar at the bottom like this (same place. Hence, we need to go one more level deeper to get what we want. Change the Command Prompt Overwrite Existing Environments Create Multiple Virtual Environments at Once Update the Core Dependencies Avoid Installing pip. Simply renaming the directory, as in this previous answer breaks the hardcoded hashbangs(#!). Then streamlit run app.py should run correctly too.Conda should have given us a simple tool like cond env rename but it hasn't. Your prompt should then have the name of the environment preprended like (streamlit_environment) >, which means python and streamlit will be run from the conda folder.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |