Common Anaconda-related Commands

Feb. 13, 2022, 2:46 p.m.

 

The following is how you can manually activate a virtual environment if the PATH variable is not properly set or working:

source anaconda3/bin/activate venv_project

 

The standard approach with a properly configured PATH for conda is as follows:

conda activate venv_project

 

Converting a Python Notebook to a Python Script on the same machine from the Command Line:

jupyter nbconvert --to script notebook_name.ipynb

 

Finding the location of a virtual environment on a machine:

conda activate venv_environment_name

echo $CONDA_PREFIX

Alternatively, you can execute this command:

conda info --envs

 

Installing a Requirements file with Anaconda:

conda install --file requirements.txt

 

Setting an environment variable within a Python Virtual Environment (venv):

# WITHIN A UNIX OR LINUX ENVIRONMENT SET THE VARIABLE
vim anaconda3/envs/venv_project/lib/python3.x/venv_project_config.py
import os
os.environ['ENV_VAR'] = 'VaRiAbLe'

# WITHIN A JUPYTER NOTEBOOK OR PYTHON FILE
import os
import venv_project_config
print(os.environ['ENV_VAR'])

Managing requirements:

conda list -e > requirements.txt

pip freeze > requirements.txt

conda install --file requirements.txt

Managing Anaconda environments:

conda info --envs

conda create -n venv_dh python=3.8.10 anaconda

 

 

~No Further Entries~


Comment Count: 1 Comments:
June 6, 2022, 9:01 p.m. - Vusaburry

https://newfasttadalafil.com/ - Cialis Prjsub prix du cialis 5mg en pharmacie ventilationperfusion studies Radiopharmaceutical is inhaled ventilation and injected intravenously perfusion followed by imaging its passage through the respiratory tract. Jngiis <a href=https://newfasttadalafil.com/>best cialis online</a> Finasteride Claravis Carmarthenshire Pwmiab https://newfasttadalafil.com/ - buy cialis generic online