dronecrew / px4tools

PX4 flight analysis tools.
BSD 3-Clause "New" or "Revised" License
84 stars 48 forks source link

Installation error on JupyterHub docker image #2

Closed kubark42 closed 8 years ago

kubark42 commented 8 years ago

I get this error when trying to install px4tools

/srv/jupyterhub# pip2 install px4tools
Collecting px4tools
  Using cached px4tools-0.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-I8E3tS/px4tools/setup.py", line 165, in <module>
        setup_package()
      File "/tmp/pip-build-I8E3tS/px4tools/setup.py", line 127, in setup_package
        write_version_py()
      File "/tmp/pip-build-I8E3tS/px4tools/setup.py", line 108, in write_version_py
        FULLVERSION, GIT_REVISION = get_version_info()
      File "/tmp/pip-build-I8E3tS/px4tools/setup.py", line 84, in get_version_info
        raise ImportError(e + "Unable to import git_revision. Try removing "
    TypeError: unsupported operand type(s) for +: 'exceptions.ImportError' and 'str'

This works on my OSX installation, where I am also using Python 2, so it's unclear to me where this problem is coming from.

kubark42 commented 8 years ago

It would seem this is related to #1, but I resolved the problem by simply eliminating this passage, e.g.

    if os.path.exists('.git'):
        GIT_REVISION = git_version()
    elif os.path.exists('px4tools/version.py'):
        # must be a source distribution, use existing version file
        try:
            from px4tools.version import git_revision as GIT_REVISION
        except ImportError as e:
            raise ImportError(str(e) + " - Unable to import git_revision. Try removing "
                              "px4tools/version.py and the build directory "
                              "before building.")
    else:
        GIT_REVISION = "Unknown"

became

    FULLVERSION = VERSION
    GIT_REVISION = git_version()

which I then installed by navigating to the directory with setup.py and running pip2 install -e .

P.S. There is also a dependency on PyLab, which might be helpful to indicate in the README.md' <-- please see #3

jgoppert commented 8 years ago

@kubark42 Thanks for the report. pip install works for me now on 0.2.8, can you confirm?

kubark42 commented 8 years ago

Installation now works, but the installed package don't seem to have any methods associated with it.

>> dir(px4tools)
['__builtins__',
 '__doc__',
 '__file__',
 '__name__',
 '__package__',
 '__path__',
 'e',
 'print_function']
jgoppert commented 8 years ago

Odd. Will look at it tonight. I typically use anaconda 3 and find that easiest to work with across all of my environments.

jgoppert commented 8 years ago

The init.py I changed to a try except block so I could get the version without having the dependencies installed. I'm guessing when you import you are missing some dependencies.

kubark42 commented 8 years ago

The init.py I changed to a try except block so I could get the version without having the dependencies installed. I'm guessing when you import you are missing some dependencies.

This would seem logical, but since pip2 install -e . works on my modified code the dependencies presumably are all present. Strangely, the upstream code installs fine with pip2 install -e ., but does not work. The only other modification I made was to change analysis.py as per https://github.com/dronecrew/px4tools/issues/3, but I don't think that's responsible for the methods not registering correctly.

jgoppert commented 8 years ago

@kubark42 Can you see if this is fixed now?

jgoppert commented 8 years ago

Should now be resolved, try package on conda-forge.