在Linux上运行Anaconda 2.7.13。代码如下:
import matplotlib
matplotlib.use('Agg')
from mpl_toolkits.basemap import Basemap
from scipy import *
import math
from math import radians, tan, sin, cos, pi, atan, sqrt, pow, asin, acos
import pylab as P
import numpy as np
from numpy import NAN
import sys
import os
import pickle as pl
mapname = "/basemap/2017-04-10_map.pickle"
#map_temp = pl.load(open(mapname, 'rb'))
map_temp = pl.load(open(mapname))
有人抱怨它无法找到pyproj,我确认这可以通过交互式导入pickle和pyproj来实现。
错误如下:
Traceback (most recent call last):
File "sample.py", line 18, in <module>
map_temp = pickle.load(open(mapname))
File "/opt/Anaconda/python2/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/opt/Anaconda/python2/lib/python2.7/pickle.py", line 864, in load
dispatch[key](self)
File "/opt/Anaconda/python2/lib/python2.7/pickle.py", line 1096, in load_global
klass = self.find_class(module, name)
File "/opt/Anaconda/python2/lib/python2.7/pickle.py", line 1130, in find_class
__import__(module)
ImportError: No module named pyproj
到目前为止,我已经完成了我能想到的事情。建议?