Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot run/build tv #6

Open
fimkap opened this issue Jul 30, 2017 · 3 comments
Open

Cannot run/build tv #6

fimkap opened this issue Jul 30, 2017 · 3 comments

Comments

@fimkap
Copy link

fimkap commented Jul 30, 2017

Having troubles run tv app on macOS Sierra 10.12.6 after following the installation instructions:
brew install gdal --with-complete --without-python --HEAD
brew install python3
pip3 install tv

tv docs/obama_eye.png
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_gdal_array', [dirname(file)])
File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/imp.py", line 296, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_gdal_array'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/tv", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/tv/cli.py", line 4, in main
tv.main()
File "/usr/local/lib/python3.6/site-packages/tv/init.py", line 314, in main
show_fn(img, **kwargs)
File "/usr/local/lib/python3.6/site-packages/tv/init.py", line 248, in show_fn
show_fd(gdal.Open(fn), *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/tv/init.py", line 243, in show_fd
show(rbs, xoff, yoff, ow, oh, w, h, r, slowout)
File "/usr/local/lib/python3.6/site-packages/tv/init.py", line 178, in show
buf_ysize=h, resample_alg=SAMPLING[r])
File "/usr/local/lib/python3.6/site-packages/osgeo/gdal.py", line 2528, in ReadAsArray
from . import gdalnumeric
File "/usr/local/lib/python3.6/site-packages/osgeo/gdalnumeric.py", line 1, in
from osgeo.gdal_array import *
File "/usr/local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 28, in
_gdal_array = swig_import_helper()
File "/usr/local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 20, in swig_import_helper
import _gdal_array
ModuleNotFoundError: No module named '_gdal_array'

Then I tried to reinstall with:
brew upgrade python3
pip3 install --ignore-installed tv

This time install of tv fails with:
extensions/gdal_wrap.cpp:9305:7: error: use of undeclared identifier 'VSICurlClearCache'
VSICurlClearCache();
^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1

----------------------------------------

Command "/usr/local/opt/python3/bin/python3.6 -u -c "import setuptools, tokenize;file='/private/var/folders/pc/ybpzm2q10xj0tqkxkvv9xf640000gn/T/pip-build-1e_84bil/gdal/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/pc/ybpzm2q10xj0tqkxkvv9xf640000gn/T/pip-l0m0yz7b-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/pc/ybpzm2q10xj0tqkxkvv9xf640000gn/T/pip-build-1e_84bil/gdal/

What can be done about this? Thanks

@daleroberts
Copy link
Owner

Hi, I've tested the above and I've been able to reproduce the problem. It's due to the dependency GDAL (and not tv) which fails to install properly using homebrew. It's quite annoying since homebrew's version of gdal is way behind (v1) so the '--HEAD' flag was a nice workaround to get version (2.2+) but I think there might be something either wrong with the HEAD version or homebrew is incorrectly patching something... I'll need to investigate.

@sethwoodworth
Copy link

On ubuntu 17.10, the same error happens when calling tv.

Traceback (most recent call last):
  File "/home/swoodworth/.local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_gdal_array', [dirname(__file__)])
  File "/usr/lib/python3.6/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_gdal_array'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/swoodworth/.local/bin/tv", line 11, in <module>
    load_entry_point('tv==0.1', 'console_scripts', 'tv')()
  File "/home/swoodworth/.local/lib/python3.6/site-packages/tv/cli.py", line 4, in main
    tv.main()
  File "/home/swoodworth/.local/lib/python3.6/site-packages/tv/__init__.py", line 314, in main
    show_fn(img, **kwargs)
  File "/home/swoodworth/.local/lib/python3.6/site-packages/tv/__init__.py", line 248, in show_fn
    show_fd(gdal.Open(fn), *args, **kwargs)
  File "/home/swoodworth/.local/lib/python3.6/site-packages/tv/__init__.py", line 243, in show_fd
    show(rbs, xoff, yoff, ow, oh, w, h, r, slowout)
  File "/home/swoodworth/.local/lib/python3.6/site-packages/tv/__init__.py", line 178, in show
    buf_ysize=h, resample_alg=SAMPLING[r])
  File "/home/swoodworth/.local/lib/python3.6/site-packages/osgeo/gdal.py", line 2536, in ReadAsArray
    from . import gdalnumeric
  File "/home/swoodworth/.local/lib/python3.6/site-packages/osgeo/gdalnumeric.py", line 1, in <module>
    from osgeo.gdal_array import *
  File "/home/swoodworth/.local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 28, in <module>
    _gdal_array = swig_import_helper()
  File "/home/swoodworth/.local/lib/python3.6/site-packages/osgeo/gdal_array.py", line 20, in swig_import_helper
    import _gdal_array
ModuleNotFoundError: No module named '_gdal_array'

I have libgdal-dev installed

@sethwoodworth
Copy link

My issue on Ubuntu seems to have been addressed in this launchpad issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants