Use anaconda environment without activation? (e.g. in Krontaba)

After reading this

http://conda.pydata.org/docs/using/envs.html

Is it possible to launch a conda python directly without having source activate xxx?

In VirtualEnv, you can find the exact location of the python executable and run something like this

./path/to/my/venv/bin/python xxx.py

Then xxx.py will be launched with the environment. This is useful for writing single-line fonts in Crontab.

Can I do the same with anaconda / miniconda environments?

I tried this on Centos 6.5, the system has python 2.5, which is too old.

I installed python 2.7 with miniconda, now I install uWSGI when it starts directly, says

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

But when it runs in conda env mode, it works as expected.

+4
2

conda :

source activate <env name> && python xxx.py && source deactivate

conda , :

source /path/to/conda/bin/activate /path/to/desired/env_name/ && python xxx.py && source deactivate

+6

, , venv miniconda. path_to_miniconda - miniconda,

/path_to_miniconda/envs/name_of_env/bin/python xxx.py

.

0

All Articles