UnsupportedOperation:fileno

时间:2016-03-15 18:11:22

标签: django python-imaging-library

尝试上传文件时收到以下错误消息:

import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np

field = np.random.rand(800,800)

fig, axes = plt.subplots(nrows=1, ncols=3, figsize=(18,6))
fig.subplots_adjust(hspace=0.1,wspace=0.1)

gs = gridspec.GridSpec(1, 3)

ax = plt.subplot(gs[0])

plt.imshow(field)

plt.xlabel("$x$")
plt.ylabel("$y$")

ax = plt.subplot(gs[1])

plt.imshow(field)

plt.xlabel("$x$")
plt.ylabel("")

ax = plt.subplot(gs[2])

sc = ax.imshow(field, vmin=0.0, vmax=1.0)

plt.xlabel("$x$")
plt.ylabel("")

divider = make_axes_locatable(ax)
cax = divider.append_axes("right", size="2%", pad=0.05)

cbar = plt.colorbar(sc, orientation = 'vertical', cax=cax)
cbar.set_label("colors")
cbar.set_ticks([0.0,1.0])

plt.savefig('test.png', bbox_inches='tight')

我已经安装了Pillow 3.1。和django调整大小。在本地完美运行但在我的外部服务器上没有。

1 个答案:

答案 0 :(得分:0)

我已经删除了Pillow,现在它可以正常工作。

相关问题