我在我的Python和Plone项目中使用了Shapely包。在eggs部分下的packages.cfg文件中,我使用shapely来下载
[eggs]
main =
Shapely
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
我不知道矢量化的错误。任何人都可以提供帮助。
答案 0 :(得分:1)
你需要安装Numpy或Cython
在我的情况下,我使用了virtualenv所以我只是做了
pip install numpy cython
您的问题是缺乏有关您环境的信息,所以我不能说这是否适合您。