Description
@sreeder and @horsburgh, following up on our call from Monday, I've installed ODM2API. I think it needs more work, but here's what I did that was successful.
- I created a conda environment with all high-level dependencies, plus some more. This wasn't necessary, strictly, speaking, but I definitely wanted to test this installation in a virtual environment that wouldn't mess with my system Python. Plus staging things with conda makes for a more controlled environment. FYI:
conda create -n odm2_apitest1 python=2.7 ipython-notebook pandas seaborn sqlalchemy psycopg2 pymysql pyodbc
. - I followed that step with
pip install geoalchemy2
(geoalchemy2 is not currently available as a conda package), b/c geoalchemy2 turned out to be a dependency in the ODM2APIsetup
git branch that's not handled by thepython setup.py develop
step below. I found out the hard way, when I tried to runimport api
after installing ODM2API. - Made sure I was on the
setup
ODM2API git branch. - cd'd to the ODM2API
src
directory (wheresetup.py
) is found, and per Stephanie's instructions, ranpython setup.py develop
. This went very smoothly and quickly, as I already had all the dependencies in place
So far so good. Per Stephanie's instructions, I was then able to run import api
w/o errors.
The first, main problem I see (in addition to the unhandled geoalchemy2 dependency) is that there's no umbrella "odm2api" package that's installed. Having to import a package called "api" is kind of dangerous and confusing. I don't have much Python package configuration chops, so I can't help with this in the very short term, and I don't know why the package is being named 'api'.
Beyond that, it's pretty involved to have to do a local git clone, then do python setup.py develop
based off the right directory path. It would be best if ODM2API could be packaged as a "pip installable" package that can be installed directly from github, like this (where setup
is the setup branch):
pip install git+https://github.com/ODM2/ODM2PythonAPI.git@setup
FYI, I tried that and got this error message:
Collecting git+https://github.com/ODM2/ODM2PythonAPI.git@setup
Cloning https://github.com/ODM2/ODM2PythonAPI.git (to setup) to /tmp/pip-yFXVBb-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 18, in <module>
IOError: [Errno 2] No such file or directory: '/tmp/pip-yFXVBb-build/setup.py'
I have a hunch the problem has to do with setup.py
being under the src
directory rather than at the base of the repo, but again, I'm reaching the depth of my understanding.
I really think it'd be time well spent if we (I'm volunteering) invested the effort very soon to turn this into a pip installable package with a proper name/namespace (eg, "odm2api", or just just "odm2"). That would make it easier for others to try it. Maybe Choonhan (and Dave V?) can help us with this?
Done for now. Have a great Thanksgiving!