Skip to content

Commit

Permalink
fixed bug when not using conda
Browse files Browse the repository at this point in the history
  • Loading branch information
sjuhel committed Mar 18, 2024
1 parent f93a305 commit 46a4307
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions boario_tools/mriot.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ def aggreg(
log.info(
"Make sure you use the same python environment as the one loading the pickle file (especial pymrio and pandas version !)"
)
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
try:
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
except KeyError:
log.info("Could not find CONDA_PREFIX, this is normal if you are not using conda.")

mrio_path = Path(mrio_path)
if not mrio_path.exists():
Expand Down Expand Up @@ -266,7 +269,11 @@ def preparse_exio3(mrio_zip: str, output: str):
log.info(
"Make sure you use the same python environment as the one loading the pickle file (especial pymrio and pandas version !)"
)
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
try:
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
except KeyError:
log.info("Could not find CONDA_PREFIX, this is normal if you are not using conda.")

mrio_path = Path(mrio_zip)
mrio_pym = pymrio.parse_exiobase3(path=mrio_path)
log.info("Removing unnecessary IOSystem attributes")
Expand Down Expand Up @@ -394,7 +401,11 @@ def preparse_euregio(mrio_csv: str, output: str, year):
log.info(
"Make sure you use the same python environment as the one loading the pickle file (especial pymrio and pandas version !)"
)
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
try:
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
except KeyError:
log.info("Could not find CONDA_PREFIX, this is normal if you are not using conda.")

ioz, ioy, iova = build_from_csv(mrio_csv, inv_treatment=True)
euregio = pymrio.IOSystem(
Z=ioz,
Expand Down Expand Up @@ -428,7 +439,13 @@ def preparse_eora26(mrio_zip: str, output: str, inv_treatment=True):
log.info(
"Make sure you use the same python environment as the one loading the pickle file (especial pymrio and pandas version !)"
)
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))

try:
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
except KeyError:
log.info("Could not find CONDA_PREFIX, this is normal if you are not using conda.")


mrio_path = Path(mrio_zip)
mrio_pym = pymrio.parse_eora26(path=mrio_path)
log.info("Removing unnecessary IOSystem attributes")
Expand Down Expand Up @@ -480,7 +497,12 @@ def preparse_oecd_v2018(mrio_zip: str, output: str):
log.info(
"Make sure you use the same python environment as the one loading the pickle file (especial pymrio and pandas version !)"
)
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))

try:
log.info("Your current environment is: {}".format(os.environ["CONDA_PREFIX"]))
except KeyError:
log.info("Could not find CONDA_PREFIX, this is normal if you are not using conda.")

mrio_path = Path(mrio_zip)
mrio_pym = pymrio.parse_oecd(path=mrio_path)
log.info("Removing unnecessary IOSystem attributes")
Expand Down

0 comments on commit 46a4307

Please sign in to comment.