我正在为我的 Python 和 Plone 项目使用 Shapely 包。在鸡蛋部分下的 packages.cfg 文件中,我使用 shapely 像这样下载
[eggs]
main =
Shapely
在 bin/buildout 期间,我发现 shapely.vectorized 存在问题。错误似乎是这样的
Numpy or Cython not available, shapely.vectorized submodule not being built.
我为我的 python 函数创建了单元测试。当我运行我的文件时,我得到了错误。错误的追溯是
Module: shapely.tests.test_validation
Traceback (most recent call last):
File "/home/nirmalsudhir/zope/myProject/eggs/Shapely-1.3.3-py2.7-linux-i686.egg/shapely
/tests/__init__.py", line 27, in <module>
from . import test_doctests, test_prepared, test_equality, test_geomseq, \
File "/home/nirmalsudhir/zope/myProject/eggs/Shapely-1.3.3-py2.7-linux-i686.egg/shapely
/tests/test_vectorized.py", line 3, in <module>
from shapely.vectorized import contains, touches
File "/home/nirmalsudhir/zope/myProject/eggs/Shapely-1.3.3-py2.7-linux-i686.egg/shapely
/vectorized/__init__.py", line 3, in <module>
from ._vectorized import contains, touches
ImportError: No module named _vectorized
shapely/tests/__init__.py
:
import sys
from shapely.geos import geos_version_string, lgeos, WKTWriter
from shapely import speedups
try:
import numpy
numpy_version = numpy.version.version
except ImportError:
numpy = False
numpy_version = 'not available'
if lgeos.geos_version >= (3, 3, 0):
WKTWriter.defaults = {}
if sys.version_info[0:2] <= (2, 6):
import unittest2 as unittest
else:
import unittest
from . import test_doctests, test_prepared, test_equality, test_geomseq // I get error here
shapely/tests/test_vectorized.py:
from . import unittest, numpy
from shapely.geometry import Point, box, MultiPolygon
from shapely.vectorized import contains, touches
shapely/vectorized/__init__.py:
from ._vectorized import contains, touches
我不知道矢量化有什么问题。任何人都可以帮忙。