Closed jleagle94 closed 4 years ago
Thank you for the detailed report. I will generate a new version of the Fermibottle docker container with updated versions of conda, the Fermitools, and other software.
It appears that your final issue is being caused by a bug in the way fermipy is interacting with conda, rather than the Fermitools themselves. I will try to reproduce and fix that issue within Fermibottle
This issue will now be resolved in future versions of the FermiBottle. The problem @jleagle94 experienced came from minor differences in the python2 and python3 versions of the subprocess library. These differences should pose no problem outside of the FermiBottle docker container.
Explicitly when the fermi conda environment is activated the "conda" executable is no longer in the $PATH. It remains callable however as conda init
sets it as a bash shell alias. The python2 version of subprocess respects the shell alias, while the python3 version does not!
@jleagle94 you should be able to solve this in your local docker container by running this command from within the container:
sudo ln -s /opt/anaconda/bin/conda /home/fermi/astrosoft/bin/conda
Then you can check afterwards by running this command python -c "import fermipy; print(fermipy.get_ft_conda_version())"
which should return "2.0.0"
Dev image now available on dockerhub: https://hub.docker.com/layers/fssc/fermibottle/dev/images/sha256-edc69b9c4bdece730632c9b9209caaa2d7ebeae94f37346bd9b3737b4e26c43a?context=repo
This indeed fixes the issue (thank you! so quick too :D) but unfortunately another one arises that occurs on both Docker and my new python3 Fermitools 2.0 environment on my local machine (MacOS Catalina 10.15.6). It is still when I read in the config file. It now reads as a python runtime error:
>>> gta = GTAnalysis('test.yaml',logging={'verbosity' : 3})
/Users/jordaneagle/anaconda2/envs/fermi/lib/python3.7/site-packages/fermipy/config.py:213: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config_dict = yaml.load(open(config))
2020-09-29 18:20:08 INFO GTAnalysis.__init__():
--------------------------------------------------------------------------------
fermipy version 0.20.0
ScienceTools version 2.0.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jordaneagle/anaconda2/envs/fermi/lib/python3.7/site-packages/fermipy/gtanalysis.py", line 356, in __init__
comp = self._create_component(cfg, loglevel=self.loglevel)
File "/Users/jordaneagle/anaconda2/envs/fermi/lib/python3.7/site-packages/fermipy/gtanalysis.py", line 942, in _create_component
for k in cfg.keys():
RuntimeError: dictionary changed size during iteration
I thought it was a conflicting problem with Catalina but since it now occurs on the Docker set up (after running the sudo ln -s /opt/anaconda/bin/conda /home/fermi/astrosoft/bin/conda
) I'm not so sure.
This looks more like an issue with fermipy than with the fermitools or the docker container. Perhaps they failed to properly update to the new python3 way of iterating over a dictionary. I recommended taking it up with them in either their GitHub repo or the slack channel.
ok great, will contact them then, thanks!
Hi all,
I use the docker container (currently up to date at version 2.3.0.5) to pull the fssc/fermibottle and then do my analysis that way. The fermibottle container is behind (conda 4.6.14 with fermitools 1.0.5) so I tried to update conda in order to update fermitools to 2.0.0 and here is the prescription I followed:
To update conda to 4.8.* I run the following
This allows conda to update to 4.8.3.
Then I created my python3 environment to prepare for fermitools 2.0*
(base) [fermi@5b0b1bac1d2e ~]$ conda create --named python3 python=3.7
I activated my python3 environment and then downloaded the fermitools 2.0.0
(python3) [fermi@5b0b1bac1d2e ~]$ conda create --name fermi -c conda-forge -c fermi fermitools
(which removes my old fermi (1.0.5) environment) I like to use fermipy so I download this using "conda install fermipy" within my fermi environment. I can see everything is up to date nowso when I open python and import fermipy, things run as usual until I try to read in my configuration file.
There is nowhere in my config file that says 'conda'. I have checked with older config files that I know work and I still get the same error. What is going on?
Thanks