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

How to make imageio work nice on systems with no internet connection? #42

Closed
almarklein opened this issue Nov 18, 2014 · 12 comments · Fixed by #45
Closed

How to make imageio work nice on systems with no internet connection? #42

almarklein opened this issue Nov 18, 2014 · 12 comments · Fixed by #45

Comments

@almarklein
Copy link
Member

Right now, imageio downloads external dependencies (the freeimage library, the avbin library, and the freeimage exe) at runtime, and caches them in the appdata directory. This keeps imageio lightweight and only fetches these rather large files when needed.

However, for people working in an environment with no internet connection, this makes makes imageio much less useful. We should aim to at least get the freeimage library available. And perhaps also some of our image suite.

@almarklein
Copy link
Member Author

Just to kick it off. Here are some options:

  • Download libs at runtime (current solution)
  • Download libs at install time (apparently also not very robust)
  • Distribute platform specific lib with dist package. This means we'd have to provide a dist package for each platform.
  • Provide two dist packages. One with source only, and one that contains the lib for all platforms, for those who cannot rely on an Internet connection. We definitely don't want to do this for ffmpeg.

Question:

  • For the cases with no Internet connection, would it be acceptable for some plugins not to work? For ffmpeg we can also use the system installed.

@blink1073
Copy link
Member

I'd vote to have a source-only version, and wheels for 64 bit Linux, Windows, and OSX with just the freeimage support. Rather that auto-downloading, it would be nice to present the user with the option of whether to download an external lib, perhaps as a simple Tk dialog. I think partial functionality is fine in this case given the nature of the library.

@sametmax
Copy link

You can make plugins optionals.

pip install imageio (or python setup.py) would install the simple version.

pip install imageio[pluginname, pluginname] install imageio with the desired plugins.

You can use extras_require for this :

https://pythonhosted.org/setuptools/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies

@almarklein
Copy link
Member Author

I'd vote to have a source-only version, and wheels for 64 bit Linux, Windows, and OSX with just the freeimage support.

@blink1073 I've made some progress in this direction, but get into a problem: Wheel sees that imageio is pure Python and thus the resulting wheels get a name that indicates its cross-plaform. I've asked the wheel guys about a possible solution: https://bitbucket.org/pypa/wheel/issue/128

Another solution would be to pack the 64bit libs for osx/win/linux into a single cross-platform wheel. Together these 3 libs take up 12.8 MB. Not an ideal solution, but it might be acceptable if we do not find a solution for the above problem. WDYT?

@blink1073
Copy link
Member

Rather than bundled all together they could be made available for download on Github. In my experience as long as I could go download one file and install it in the lab, it would be doable.

@almarklein
Copy link
Member Author

Now I am confused :) if you can download that file by hand, why can imageio not download it for you automatically?

@blink1073
Copy link
Member

Portable harddrives work as long as the installation does not have a dependency trail.

@almarklein
Copy link
Member Author

Ah, right. Makes sense. Nevertheless, shipping freeimage in the dist distribution is still something wanted for e.g. Debian building (#40). So I will first try some more in that direction ...

@ghisvail
Copy link
Contributor

ghisvail commented Dec 8, 2014

FYI, freeimage is available in Debian [1]. But this issue summarizes the problem I faced with the Debian package, i.e. the need to perform a complete build / install / test / clean of the package, without relying on downloading any external resources.

[1] https://packages.debian.org/source/sid/libs/freeimage

@almarklein
Copy link
Member Author

@blink1073 and @ghisvail I have now implemented an approach that creates additional platform-specific archives for pypi. An example: https://testpypi.python.org/pypi/imageio/1.0.0.9.7dev

Also there is python setup.py build_with_fi install to download the freeimage library and some images required during testing at build-time.

Please let me know if this would cover your needs.

@almarklein
Copy link
Member Author

See #45

@blink1073
Copy link
Member

@almarklein, looks good to me (just having viewed the diff)

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

Successfully merging a pull request may close this issue.

4 participants