spacetelescope / hstaxe

hstaxe is the python and C follow on to the aXe package which was maintained in IRAF for many years.
Other
10 stars 15 forks source link

Cannot install #1

Open bkornpob opened 4 years ago

bkornpob commented 4 years ago

Hi pyaXe Team,

I downloaded the repo, and created new conda environment (i.e., conda create --name pyaxe which gives Python 3.8.0 with no package when using conda list). From setup.cfg, individual packages (including setuptools_scm, setuptools, numpy, astropy, wcstools, cfitsio, gsl, stwcs, backports.tempfile, pytest, requests_mockl, pytest-catchlog, sphinx, and sphinx-automodapi) were installed. Then, from the pyaxe folder, using python setup.py install gives an error shown here. I found this discussion on github about the LookupError (https://github.com/pypa/setuptools_scm/issues/278), but I don't know if this would help.

Thank you, KB

(pyaxe) altalune:pyaxe-master kbhirombhakdi$ python setup.py install Traceback (most recent call last): File "setup.py", line 215, in setup( File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(attrs) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools/dist.py", line 447, in init _Distribution.init(self, { File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/distutils/dist.py", line 292, in init self.finalize_options() File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools/dist.py", line 740, in finalize_options ep.load()(self) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools/dist.py", line 747, in _finalize_setup_keywords ep.load()(self, ep.name, value) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools_scm/integration.py", line 17, in version_keyword dist.metadata.version = get_version(value) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools_scm/init.py", line 150, in get_version parsed_version = _do_parse(config) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.8/site-packages/setuptools_scm/init.py", line 105, in _do_parse raise LookupError( LookupError: setuptools-scm was unable to detect version for '/Users/kbhirombhakdi/Downloads/pyaxe-master'.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

sosey commented 4 years ago

Try this sequence of commands. Let's start with a new environment to make it clean:

conda create -n test-pyaxe-install -c http://ssb.stsci.edu/astroconda python=3 numpy astropy gsl stwcs wcstools cfitsio drizzlepac stsci.imagestats

conda activate test-pyaxe-install

give it a go and let me know what happens

git clone https://github.com/spacetelescope/pyaxe.git

cd pyaxe

python setup.py install

This gives me:

pyaxe 0.1.dev29+g386d88b pypi_0 pypi

bkornpob commented 4 years ago

I had no problem creating the environment. But, I cannot clone using the command line. It gave an error:

remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/spacetelescope/pyaxe.git/'

Note: I used my github username and password.

So, I cloned by using the web interface, had pyaxe unzipped, and followed the installation. It gave an error:

(pyaxe) altalune:pyaxe kbhirombhakdi$ python setup.py install Traceback (most recent call last): File "setup.py", line 237, in package_dir={'': '.'}, File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(attrs) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/distutils/core.py", line 108, in setup _setup_distribution = dist = klass(attrs) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools/dist.py", line 448, in init k: v for k, v in attrs.items() File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/distutils/dist.py", line 292, in init self.finalize_options() File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools/dist.py", line 740, in finalize_options ep.load()(self) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools/dist.py", line 747, in _finalize_setup_keywords ep.load()(self, ep.name, value) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools_scm/integration.py", line 17, in version_keyword dist.metadata.version = get_version(value) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools_scm/init.py", line 150, in get_version parsed_version = _do_parse(config) File "/Users/kbhirombhakdi/anaconda3/envs/pyaxe/lib/python3.7/site-packages/setuptools_scm/init.py", line 113, in _do_parse "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root LookupError: setuptools-scm was unable to detect version for '/Users/kbhirombhakdi/_work/pyaxe'.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

For example, if you're using pip, instead of https://github.com/user/proj/archive/master.zip use git+https://github.com/user/proj.git#egg=proj

bkornpob commented 4 years ago

I followed this instruction (by Susana), and the installation went through:

  1. Make a new python 3 environment and a test directory:

mkdir pyaxetest cd pyaxetest conda create --name pyaxe python=3

  1. activate the new environemt

conda activate pyaxe

  1. install additional packages

conda install wcstools -c http://ssb.stsci.edu/astroconda conda install cfitsio gsl git clone https://github.com/sosey/pyaxe.git conda install drizzlepac

  1. change directory

cd pyaxe python setup.py install

  1. make sure to be in this directory: /Users/deustua/pyaxetest/pyaxe

  2. run the code: python pyaxe/tests/run_cookbook.py

that’s as far as I got – it’s now asking for the G141.lis file and the cookbook_data files. so that’s progress .

NOTE: I could download the repo directly from github using the command line, and the installation was successful. NOTE: I tried installing again by downloading the repo from the web interface. This gave the same error as previously posted.