astrocatalogs / astrocats

Astrocats package for constructing astronomical catalogs
https://astrocats.space
MIT License
40 stars 12 forks source link

astrocats cannot import catalogs when installed with Anaconda #91

Closed Zeklandia closed 6 years ago

Zeklandia commented 6 years ago

Attempting to import a catalog fails because the base directory of astrocats is not a Git repository.

$ python -m astrocats supernovae import
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
  File ".../anaconda3/envs/astro3/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File ".../anaconda3/envs/astro3/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File ".../anaconda3/envs/astro3/lib/python3.6/site-packages/astrocats/__main__.py", line 6, in <module>
    main.main()
  File ".../anaconda3/envs/astro3/lib/python3.6/site-packages/astrocats/main.py", line 28, in main
    args, sub_clargs = load_command_line_args()
  File ".../anaconda3/envs/astro3/lib/python3.6/site-packages/astrocats/main.py", line 163, in load_command_line_args
    git_vers = get_git()
  File ".../anaconda3/envs/astro3/lib/python3.6/site-packages/astrocats/main.py", line 301, in get_git
    git_vers = subprocess.check_output(["git", "describe", "--always"]).strip()
  File ".../anaconda3/envs/astro3/lib/python3.6/subprocess.py", line 336, in check_output
    **kwargs).stdout
  File ".../anaconda3/envs/astro3/lib/python3.6/subprocess.py", line 418, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['git', 'describe', '--always']' returned non-zero exit status 128.
guillochon commented 6 years ago

From the other issue you opened I'm assuming you got this working?

Zeklandia commented 6 years ago

No, I uninstalled the Anaconda version and cloned the repo directly. I couldn't get it to work installed with Anaconda.

lzkelley commented 6 years ago

Hi @Zeklandia, sorry for the super slow response. I don't think astrocats is able to function when installed via Anaconda at the moment (actually: with the current structure of the code, in general). The anaconda installed astrocats will only work as a library dependency (e.g. providing class structures for mosfit) at the moment. I'll add a warning to this in the docs, thanks for pointing it out. The only solution, for the moment, is to install via git and use that. Hopefully everything is working fine for you now. One thing to be aware of is that you may be working with numerous versions of astrocats at the moment, one via anaconda which is used in import statements from other packages, and another version via git that used directly for catalogs.