Open forman opened 7 years ago
It is strange, shapefile
is the main module of pyshp, see https://pypi.python.org/pypi/pyshp, but:
> python -c "import sys; print(sys.executable)"
C:\Users\Norman\cate-0.9.0.dev7\python.exe
> conda list pyshp
# packages in environment at C:\Users\Norman\cate-0.9.0.dev7:
#
pyshp 1.2.12 py_0 conda-forge
> python -c "import shapefile"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'shapefile'
Found the reason. There is a site-packages
folder in the wrong location which includes the desired module.py
:
> cd C:\Users\Norman\cate-0.9.0.dev7\site-packages
> dir
...
23.09.2017 12:08 <DIR> .
23.09.2017 12:08 <DIR> ..
23.09.2017 12:05 <DIR> h5netcdf
23.09.2017 12:05 <DIR> h5netcdf-0.4.2-py3.6.egg-info
23.09.2017 12:06 <DIR> owslib
23.09.2017 12:06 <DIR> OWSLib-0.15.0-py3.6.egg-info
23.09.2017 12:07 <DIR> pyshp-1.2.12-py3.6.egg-info
24.08.2017 17:57 52.285 shapefile.py
23.09.2017 12:08 <DIR> zict
23.09.2017 12:08 <DIR> zict-0.1.3-py3.6.egg-info
Google gives:
It seems that the problem is caused by conda
when installing packages that usually go via pip. But Cate used to work before.
Not really fixed, but my workaround is in cate.core.__init__.py
:
extra_path = os.path.join(sys.prefix, 'site-packages')
if os.path.isdir(extra_path) and extra_path not in sys.path:
sys.path.append(extra_path)
After installation (current 0.9.0.dev7, Windows 10) and in the Cate CLI:
Coming from cartopy which requires pyshp, which should actually be available:
Specifications
Cate 0.9.0.dev7, Windows 10