我的设置是
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
我有scipy 0.17
和cartopy'0.14.2'。
我所要做的就是
plt.axes(projection=ccrs.PlateCarree())
它导致了这个:
Traceback (most recent call last):
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2885, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-93-636aeb1a7fc6>", line 1, in <module>
plt.axes(projection=ccrs.PlateCarree())
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 867, in axes
return subplot(111, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1022, in subplot
a = fig.add_subplot(*args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/figure.py", line 987, in add_subplot
self, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/matplotlib/projections/__init__.py", line 100, in process_projection_requirements
projection_class, extra_kwargs = projection._as_mpl_axes()
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/crs.py", line 150, in _as_mpl_axes
import cartopy.mpl.geoaxes as geoaxes
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/mpl/geoaxes.py", line 52, in <module>
from cartopy.vector_transform import vector_scalar_to_grid
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/cartopy/vector_transform.py", line 26, in <module>
from scipy.interpolate import griddata
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/interpolate/__init__.py", line 158, in <module>
from .interpolate import *
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/interpolate/interpolate.py", line 12, in <module>
import scipy.special as spec
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/special/__init__.py", line 629, in <module>
from .basic import *
File "/opt/pycharm-2016.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/usr/local/anaconda2/envs/myenv3/lib/python3.5/site-packages/scipy/special/basic.py", line 14, in <module>
from ._ufuncs import (ellipkm1, mathieu_a, mathieu_b, iv, jv, gamma, psi, zeta,
ImportError: cannot import name 'zeta'
内心深处这似乎是一个scipy问题,但我有最新的 - 这里发生了什么?
答案 0 :(得分:2)
来自<sql:setDataSource var="con" driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/PosPromo"
user="root" password="qwerty"/>
// here I am waiting an array of integers from another JSP page, they are ID in my DB
<% String [] val =request.getParameterValues("aaa"); %>
<% request.setAttribute("val",val); %>
<%! String str=""; %>
<% for (int j=0;j<val.length;j++){
if (j==(val.length-1)){
str+=" id="+String.valueOf(val[j]);
break;
}
str+=" id="+String.valueOf(val[j])+" OR";
}
%>
<%str="SELECT * FROM action WHERE "+str+";";%>
// here I obtain string smth like "SELECT * FROM action WHERE id=3;" which realy works in DB
<c:set var="que" value="str"/>
<sql:query dataSource="${con}" var="result">
"${que}";
</sql:query>
的{{1}}安装证明是个问题。创建新环境并重新安装scipy
解决了这个问题。