lessthanoptimal / PyBoof

Python wrapper around the BoofCV Computer Vision Library
Apache License 2.0
67 stars 12 forks source link

AttributeError: module 'mmap' has no attribute 'MAP_SHARED' #6

Closed GokulNC closed 4 years ago

GokulNC commented 4 years ago

I get that error on running pb.init_memmap(). BTW, I am on Windows.

GokulNC commented 4 years ago

Solution: If the OS is Windows, replace the following line

mmap_file = mmap.mmap(mmap_fid.fileno(), length=0)

here: https://github.com/lessthanoptimal/PyBoof/blob/be6fec7/pyboof/__init__.py#L147

Reason: Different mmap APIs for different OS: https://docs.python.org/3/library/mmap.html#mmap.mmap

lessthanoptimal commented 4 years ago

Thanks for pointing this out and telling me up to fix it! This also lead to me running Python on windows for the first time to test it.