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

pytiff fails to install on Windows #15

Open
sbhoek opened this issue Aug 30, 2019 · 13 comments
Open

pytiff fails to install on Windows #15

sbhoek opened this issue Aug 30, 2019 · 13 comments

Comments

@sbhoek
Copy link

sbhoek commented Aug 30, 2019

This issue is related to the one entitled "Missing dependency: Cython", which was closed. I'm very happy to hear about pytiff! It is exactly what I have been looking for, already for some time. At first I installed pytiff as part of my Python 3.6.5 instance (32-bits). When I tried to run it, I got the error "Cython modules not available". Because I read that this problem had been fixed for Python 3.7, I decided to do a fresh install of Python 3.7.4. After installing, I even upgraded pip. Unfortunately, I have to conclude that the issue has not yet been resolved fully. I'm attaching the error messages. I hope this can be resolved, so that I can use pytiff without hesitations as one of the required packages in a package I'm developing myself.
pytiff_issue.txt

@sbhoek
Copy link
Author

sbhoek commented Sep 3, 2019

I also tried to install pytiff on a newly installed Ubuntu 19.04 (Disco) - by means of pip. I used both Python 2.7.16 and Python 3.7.3. What is remarkable is that in both cases I got the same error, as under Windows:
pytiff/_pytiff.cpp(655): fatal error C1083: Cannot open include file: 'tiffio.h': No such file or directory
Am I missing something or there are some files missing from the installation package?

@xgui3783
Copy link
Member

xgui3783 commented Sep 4, 2019

hmm, the tiffio.h relates to libtiff dependency. I just tried on a ubuntu 19.04 docker container, it seems you need to

apt-get install libtiff5-dev

Not too sure on windows, but this sourceforge page may shed some light on how to include tiffio.h

edit: said sourceforge link: http://gnuwin32.sourceforge.net/packages/tiff.htm

@pglock
Copy link
Contributor

pglock commented Sep 4, 2019

hm there should be a wheel for python 3.6 32 bit. You could try downloading the wheel directly and installing it.

For python 3.7 only a 64 bit version is available currently.
Are you using Anaconda on windows? You could try building it from source.

@sbhoek
Copy link
Author

sbhoek commented Sep 5, 2019

Yes, it works now under Ubuntu! On Windows, I installed pytiff again into my Python 3.6 32-bits version using that wheel, but when I import pytiff, python tells me that the Cython modules are not available. That is pytiff issue #12 which was solved for Python 3.7 - but not for Python 3.6 - and that was why I switched to Python 3.7. Unfortunately I switched to the 32-bits version, not the 64-bits version.
I normally try to have only few Python instances on my machine - hence I don't see the need to use Anaconda. To be honest, building things from source is not my favourite pastime. I tried building packages in the past, but too often had to conclude that I don't know enough about C++. Kindly provide a wheel for 32-bits Python 3.7 ...

@sbhoek
Copy link
Author

sbhoek commented Sep 5, 2019

I switched to 64-bits Python 3.7 and installed numpy and Cython before proceeding with the installation of the wheel provided here: https://pypi.org/project/pytiff/#files. Unfortunately, I got the same error message again: "Cython modules not available". When I installed pytiff with "pip install pytiff", the installation went well but I got the same error message also: "Cython modules not available".

@pglock
Copy link
Contributor

pglock commented Sep 6, 2019

I'll try to take a look at this on the weekend.
@xgui3783 Could you take a look at this as well?

64-bits Python 3.7 Anaconda is working for me. With python from python.org it isn't. Since I don't develop on Windows, I don't know if and when I'll be able to fix this.

@xgui3783
Copy link
Member

xgui3783 commented Sep 6, 2019

I have a windows non dev machine. I can take a look this weekend :D

@xgui3783
Copy link
Member

xgui3783 commented Sep 7, 2019

Am I understanding correctly that we investigating using pytiff on windows with python 3.7?

@xgui3783
Copy link
Member

xgui3783 commented Sep 7, 2019

Hmm, at least I can confirm that pip install pytiff in powershell, whilst successfully install pytiff 0.8.1, upon importing pytiff, I was greeted with Cython modules not available error

Logs:

PS C:\Users\proto> pip install pytiff
Collecting pytiff
Downloading https://files.pythonhosted.org/packages/0c/cf/86d8f90556c6af3799721166ed53a94701e30ec6b95aa9fd0cfad3329a58/pytiff-0.8.1-cp37-cp37m-win_amd64.whl (203kB)
100% |████████████████████████████████| 204kB 5.4MB/s
Installing collected packages: pytiff
Successfully installed pytiff-0.8.1
You are using pip version 19.0.3, however version 19.2.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
PS C:\Users\proto> python
Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:13:57) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pytiff
Cython modules not available
>>> exit()

edit: log for clarity

@xgui3783
Copy link
Member

xgui3783 commented Sep 7, 2019

@pglock I just checked the repo, Cython module not available is raised when there happen to be an import error. Could it be raised when other dep, such as numpy or libtiff that are missing?

@pglock
Copy link
Contributor

pglock commented Sep 7, 2019

Seems like thats the case. I installed pytiff for Python 3.7 64 bit (pure python not anaconda) and got

Cython modules not available

After installing numpy it works. Is this working for you as well?

@xgui3783
Copy link
Member

xgui3783 commented Sep 7, 2019

Hmm, one final piece of observation, with miniconda cmd, after pip install numpy cython, I was able to install and import pytiff wheel without throwing, but in the same environment, a normal cmd or ps throws the same error "cython module not found".

As the windows wheels are built with miniconda on appveyor, this may not be surprising.

I do not know how much appetite there is introducing an additional entry in the matrix

@btguilherme
Copy link

I have had the same problem and I was able to resolve by downloading/installing the whl from this site: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pytiff

I only tested it on a Windows 10 machine.

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

4 participants