Comments (7)
Sorry, Anaconda is its own weird thing, it can't use standard pip packages.
Someone needs to make a special conda package that installs the libvips binary plus the Python part of the binding. There have been a few attempts, but it's not happened yet.
from pyvips.
I meant to say, until there's a conda package the workaround is to install standard Python and use pyvips from that.
from pyvips.
Thanks John. I tried installing on one of our servers as follows:
C:\Users\Doug>pip install pyvips
Collecting pyvips
Downloading https://files.pythonhosted.org/packages/5c/6e/df4a34a9c8b349e40d6400bd4ac40558b3497732795fa0399596155b18b1/pyvips-2.1.2.tar.gz
Collecting cffi>=1.0.0 (from pyvips)
Downloading https://files.pythonhosted.org/packages/05/3f/abc53d8f0c7362181d809c913c2b348e41c193eff84c2f0445da2b615f69/cffi-1.11.5-cp36-cp36m-win32.whl (155kB)
100% |████████████████████████████████| 163kB 3.3MB/s
Collecting pycparser (from cffi>=1.0.0->pyvips)
Downloading https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz (245kB)
100% |████████████████████████████████| 256kB 3.3MB/s
Installing collected packages: pycparser, cffi, pyvips
Running setup.py install for pycparser ... done
Running setup.py install for pyvips ... done
Successfully installed cffi-1.11.5 pycparser-2.18 pyvips-2.1.2
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Note I did not use the --user option because I expect this will be used by all users on this server.
Next, I tried the following:
C:\Users\Doug>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import logging
logging.basicConfig(level=logging.DEBUG)
import pyvips
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'pyvips'
quit()
C:\Users\Doug>pip search pyvips
pyvips (2.1.2) - binding for the libvips image processing library, API mode
INSTALLED: 2.1.2 (latest)
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\Doug>vips --version
vips-8.6.3-Thu Mar 8 15:18:35 UTC 2018
Any idea what is the issue? There may be other versions of python on this machine.
Thanks again for your help.
Doug
from pyvips.
I installed Python 3.7 and tried again in my Windows 10 Pro running in Parallels and this is what happened:
C:\Users\dougwood>pip install --user pyvips
Collecting pyvips
Collecting cffi>=1.0.0 (from pyvips)
Downloading https://files.pythonhosted.org/packages/2d/9e/9d84a78d4ea3d0fa94f6d0e4bcd88406709312949f48f3853f26f8f52ebe/cffi-1.11.5-cp37-cp37m-win32.whl (154kB)
100% |████████████████████████████████| 163kB 6.6MB/s
Collecting pycparser (from cffi>=1.0.0->pyvips)
Using cached https://files.pythonhosted.org/packages/8c/2d/aad7f16146f4197a11f8e91fb81df177adcc2073d36a17b1491fd09df6ed/pycparser-2.18.tar.gz
Installing collected packages: pycparser, cffi, pyvips
Running setup.py install for pycparser ... done
Successfully installed cffi-1.11.5 pycparser-2.18 pyvips-2.1.2
You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\dougwood>
C:\Users\dougwood>vips --version
vips-8.6.5-Wed Jul 25 09:46:22 UTC 2018
C:\Users\dougwood>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)
>>> import pyvips
DEBUG:pyvips:Binary module load failed: No module named '_libvips'
DEBUG:pyvips:Falling back to ABI mode
Traceback (most recent call last):
File "C:\Users\dougwood\AppData\Roaming\Python\Python37\site-packages\pyvips\__init__.py", line 19, in <module>
import _libvips
ModuleNotFoundError: No module named '_libvips'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\dougwood\AppData\Roaming\Python\Python37\site-packages\pyvips\__init__.py", line 53, in <module>
gobject_lib = ffi.dlopen(_gobject_libname)
File "C:\Users\dougwood\AppData\Roaming\Python\Python37\site-packages\cffi\api.py", line 141, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "C:\Users\dougwood\AppData\Roaming\Python\Python37\site-packages\cffi\api.py", line 802, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "C:\Users\dougwood\AppData\Roaming\Python\Python37\site-packages\cffi\api.py", line 798, in _load_backend_lib
return backend.load_library(path, flags)
OSError: cannot load library 'C:\dev\vips\vips-dev-8.6\bin\libgobject-2.0-0.dll': error 0xc1
I checked and the path to the DLL referenced is correct:
C:\Users\dougwood>dir c:\dev\vips\vips-dev-8.6\bin\libgobject*.*
Volume in drive C has no label.
Volume Serial Number is 5A36-DDB8
Directory of c:\dev\vips\vips-dev-8.6\bin
07/25/18 10:35 AM 604,659 libgobject-2.0-0.dll
1 File(s) 604,659 bytes
0 Dir(s) 165,722,181,632 bytes free
C:\Users\dougwood>
from pyvips.
You probably saw this old issue: https://github.com/jcupitt/pyvips/issues/44#issuecomment-390160980
That was with py3.6. I'll have a go with 3.7.
from pyvips.
Well actually, after cleaning up some path issues (more than one install of Python), I think I have it installing:
C:\Program Files\Python36\Scripts>python
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> logging.basicConfig(level=logging.DEBUG)
>>> import pyvips
DEBUG:pyvips:Binary module load failed: No module named '_libvips'
DEBUG:pyvips:Falling back to ABI mode
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x000001A4FF62ACF8>
DEBUG:pyvips:Loaded lib <cffi.api._make_ffi_library.<locals>.FFILibrary object at 0x000001A4FF6155C0>
DEBUG:pyvips:Inited libvips
DEBUG:pyvips:
Does that look correct given the fall back to ABI mode? If so, I will mark this closed.
I did not move v3.7, BTW. I will see if I can start using it in my code.
from pyvips.
Yes, that looks fine. API mode only works if Python can find a working C compiler, which is often tricky on Windows.
from pyvips.
Related Issues (20)
- Reading in image a second time breaks on qptiff file HOT 6
- Documentation link to conda package HOT 1
- Create svs file with image pyramid, label and macro in pyvips? HOT 4
- Image merge stitch HOT 2
- `addalpha` has different behaviour compared to C HOT 1
- Error installing pyvips on Mac OS HOT 15
- draw_rect fill error HOT 2
- creating tiles of 16bit multiband (4 band) tiff image leaves black canvas HOT 4
- class "jxlsave" not found HOT 9
- Assertion failed: sp->cinfo.comm.is_decompressor HOT 3
- Help installing pyvips for jupyter HOT 5
- `TIFFFillTile: Read error` when writing a TIFF file on a per-tile basis. HOT 2
- Thumbnail creation taking too long HOT 2
- Unable to save images when certain combinations of them are resize()'d HOT 7
- pyvips stats HOT 1
- How does composite() merge colors? HOT 8
- ICC profiles from file stream in pyvips HOT 5
- Why is error 0x7f? HOT 1
- Can libvips' stack size be modified using pyvips? HOT 5
- Unable to convert multiband image to srgb HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyvips.