Open Mingbo-Lee opened 10 months ago
Could you provide the exact commands you run to create the virtual environment + install codecarbon
?
It could be related to codecarbon
being installed into one python version/environment and then trying to run it from a different python version/environment.
Thank you for your reply.
create the virtual environment : conda create -n my_env python=3.9
install codecarbon: conda install -c codecarbon -c conda-forge codecarbon,
which ref to https://mlco2.github.io/codecarbon/installation.html#from-conda-repository
Thanks for the reply!
I have tested on my end and I could reproduce the issue. With conda
the bin of codecarbon
is never installed, so the command codecarbon init
does not exist. This is a bug.
In the meantime I can propose 2 workarounds to use codecarbon
:
Install it via pip install codecarbon
and you will be able to use it in the command line
Create a .py
file and import the package codecarbon
. See https://mlco2.github.io/codecarbon/usage.html#quickstart for examples on how to use it as a python package
As a first glance at the root of the bug, IMHO this is something to do with https://github.com/mlco2/codecarbon/blob/master/setup.py#L58-L63 In the conda file we do not mention these entry points https://github.com/mlco2/codecarbon/blob/master/.conda/meta.yaml
Thank you very much for your reply!
Note that this one is the one used to build the conda-forge package https://github.com/conda-forge/codecarbon-feedstock/blob/8758935e5c3e3de31a1cdc78e3d2d1eb683c5f1e/recipe/meta.yaml#L16C15-L18
Description
I installed anaconda and created a virtual environment. when I run
codecarbon init
, I meet the problem as this https://github.com/mlco2/codecarbon/issues/381What I Did