WindowsError:异常:对shapely模块v的浮点操作无效。1.2.16在Python 2.7中使用PyScripter IDLE

WindowsError:异常:对shapely模块v的浮点操作无效。1.2.16在Python 2.7中使用PyScripter IDLE,python,error-handling,module,runtime-error,pyscripter,Python,Error Handling,Module,Runtime Error,Pyscripter,在Python2.7和Windows7机器上使用64位 该错误似乎与的使用有关。我在上尝试了以下代码 pythonshell和代码完美地工作 from shapely.geometry import Polygon p1 = Polygon([(0, 1), (1, 1), (1, 0), (0, 0), (0, 1)]) p2 = Polygon([(2, 4), (4, 4), (4, 2), (2, 2), (2, 4)]) p3 = Polygon([(0, 3), (3, 3), (

在Python2.7和Windows7机器上使用64位

该错误似乎与的使用有关。我在上尝试了以下代码 pythonshell和代码完美地工作

from shapely.geometry import Polygon

p1 = Polygon([(0, 1), (1, 1), (1, 0), (0, 0), (0, 1)])
p2 = Polygon([(2, 4), (4, 4), (4, 2), (2, 2), (2, 4)])
p3 = Polygon([(0, 3), (3, 3), (3, 0), (0, 0), (0, 3)])


>>> p1.intersects(p2)
False
>>> p1.intersection(p2).area
0.0

>>> p1.intersects(p3)
True
>>> p3.intersection(p1).area
1.0

>>> p3.intersects(p2)
True
>>> p3.intersection(p2).area
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Python27\lib\site-packages\shapely\geometry\base.py", line 366, in intersection
    return geom_factory(self.impl['intersection'](self, other))
  File "C:\Python27\lib\site-packages\shapely\topology.py", line 43, in __call__
    product = self.fn(this._geom, other._geom, *args)
WindowsError: exception: float invalid operation

无法复制-我得到1.0,毫无例外,大概是因为我在Mac@DavidRobinson,奇怪的事实。我尝试了不同的机器窗口8,我没有得到错误。仅在这台机器上查看Windows错误备份该错误。顺便说一句,在代码中附上一个问题可能是一个好主意,也许只是提到操作系统和shapely版本等,这样更容易阅读。在Python2.7和Windows7机器上。形状模v。1.2.16@DavidRobinson. 我在Python2.7的空闲版本上尝试过,而不是在PyScripter上,我没有遇到这个错误。与Pyscripter的使用相关的外观