openpaperwork / pyinsane

Python library to access and use image scanners (Linux/Windows/etc) (Sane/WIA) -- Moved to Gnome's Gitlab
https://gitlab.gnome.org/World/OpenPaperwork/pyinsane
63 stars 24 forks source link

Can't install pyinsane2 #34

Open Masaaq opened 6 years ago

Masaaq commented 6 years ago

While installing via pip install pyinsane2

returns message

    cl : Command line warning D9025 : overriding '/DNDEBUG' with '/UNDEBUG'
    properties.cpp
    c1xx: fatal error C1083: Cannot open source file: 'pyinsane2/wia/properties.cpp': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

I understand that it can't find the properties file, but I don't know how to fix this.

Thanks in advance

jflesch commented 6 years ago

It's weird. It should work. I'm going to try as soon as possible .. which may not be before a week or two .. :/

Anyway, in the meantime, what you can try is:

This is the way I install it.

Masaaq commented 6 years ago

Thanks for reply!

pyinsane2/wia/properties.cpp(3) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory

ried to do it manually, now it gives me this one.

jflesch commented 6 years ago

Hm, weird. stdint.h is a standard C header (not a C++ one however). Just to be sure: Does your installation of Visual Studio includes all the C and C++ tools ?

Pyinsane has to mix C and C++ (C++ to access the scanner using WIA2, and C for Python bindings). You will also need Windows Driver Kit.

jflesch commented 6 years ago

Hm, stdint.h may actually be provided by WinDDK (I don't have a Windows computer available right now so I can't check). If so, the problem may be related to WinDDK location.

setup.py assumes that, by default, WinDDK is installed in c:\winddk\7600.16385.1. Which is unlikely to be your case I guess. You can define the following environment variables to fix that:

jflesch commented 6 years ago

b0a5c2d5ef0e80f1e92fc3012c2f7880bad715a9

jflesch commented 6 years ago

BTW, I forgot to ask (sorry), but when you did install visual studio, did you install the C dev tools (headers, etc) ? For reference, I'm working with Python 3.4, therefore I installed Visual C++ 10 and not 14.

OddlyDoddly commented 6 years ago

My friend is also having this issue verified he's installed cpp build tools for visual studio 14

jflesch commented 6 years ago

As I mentioned before, it's a C header, not a C++ one.

It seems it's now part of the Windows SDK and is not included anymore in Visual Studio: https://social.msdn.microsoft.com/Forums/vstudio/en-US/0f580a73-6f11-4aa6-abbe-6bf1438734c2/standard-files-stddefh-stringh-missing-in-visual-studio-2015-rc#de6385c2-63bf-4a02-a7dc-77972f98ab07 https://social.msdn.microsoft.com/Forums/vstudio/en-US/cfa48739-cd32-43d2-9d27-2b6653da6645/canf-find-standard-c-header-file-in-visual-studio-2015-community-version#38b883ab-1918-470d-8565-673d85a0ffc0

I'll update the documentation when I have time.

Maier123 commented 6 years ago

Had the same issue for a very long time, but what you have to do is make the system look in the right path. So go the properties.cpp file in visual Studio and open the properties page (Thats what it is called in VS 2017). you'll find this page in the properties tab (on the right hand side) by clicking the wrench symbol. In there go to Configuration properties -> General -> Include search Path and add the path to the file that cannot be found, so in your case the properties.cpp file. Press apply and run again. hopefully it works. Im sorry all this refers to VS 2017 but the process should be the same probaply just different names.

jflesch commented 6 years ago

I'm seriously considering rewriting this library to make things simpler.

I'm thinking of a C library that would be built mostly using Mingw / Msys2 + GLib + GObject. The main advantages would be:

The drawbacks would be:

It would also be an opportunity for me to make a better API.