Closed GernotMaier closed 7 years ago
@GernotMaier - I think you're importing some old version of gamma-cat from your site-packages.
The PowerLaw2
class is there in master:
https://github.com/gammapy/gammapy/blob/master/gammapy/spectrum/models.py#L515
Works for me:
$ python
Python 3.5.3 (default, Jan 21 2017, 15:44:58)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gammapy
>>> gammapy
<module 'gammapy' from '/Users/deil/code/gammapy/gammapy/__init__.py'>
>>> gammapy.__version__
'0.6.dev4427'
>>> from gammapy.spectrum.models import PowerLaw2
@GernotMaier - Can you execute the same code and paste the output here?
Maybe try pip uninstall gammapy
a few times until it's gone from your site-packages
, and then install the master version and check that you have the latest (should be 0.6.dev4426
I think).
I am really close to giving up installing gammapy....
python
Python 3.4.5 |Anaconda 4.3.1 (x86_64)| (default, Jul 2 2016, 17:47:57)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gammapy
>>> gammapy
<module 'gammapy' from '/Users/maierg/anaconda/envs/python34/lib/python3.4/site-packages/gammapy/__init__.py'>
>>> gammapy.__version__
'0.4'
It seems that I have three versions installed:
/Users/maierg/anaconda/envs/python34/lib/python3.4/site-packages/gammapy
/Users/maierg/anaconda/envs/python34/lib/python3.4/site-packages/gammapy-0.4-py3.4.egg-info/
/Users/maierg/anaconda/envs/python34/lib/python3.4/site-packages/gammapy-0.6.dev4426-py3.4-macosx-10.6-x86_64.egg/
How do I select the version I want to use?
Weird thing is that I get for
$ gammapy-info --version
*** Gammapy version info ***
version: 0.6.dev4426
release: False
githash: 9679fb8d6a98debacd8690cb15c608524661367f
Try to get rid of the old versions you have in site-packages
:
pip uninstall gammapy
conda uninstall gammapy
Then install the dev version.
Note that the gamma-cat
scripts won't work with Python 3.4: https://github.com/gammapy/gamma-cat/issues/64#issuecomment-296217378
@GernotMaier - If you just want to do some data entry for gamma-cat, just put the files with the data and I'll fix any formatting or data entry issues.
OK - that worked. Thanks.
I also want to use gammapy, so this was important for me.
PowerLaw2 seems not to be included in gammapy/spectrum/models.py for the following version: