使用beeswarm时出现“ TypeError:'模块'对象不可调用”错误

时间:2018-10-30 06:34:05

标签: python module beeswarm

我尝试使用beeswarm通过以下代码绘制一些数据:

import beeswarm
from beeswarm import *
import numpy as np

d = np.array([0,1,2,3,4])
beeswarm([d])

然后出现错误:

Traceback (most recent call last):
  File "/home/sunyp/softwares/build/Anaconda2-5.1.0/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 2882, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-21-26de9ff62f6f>", line 1, in <module>
    beeswarm([d1])
TypeError: 'module' object is not callable

有人知道如何处理这个问题吗?预先谢谢你。

1 个答案:

答案 0 :(得分:0)

确保已安装pybeeswarm。这对我有用:

import matplotlib.pyplot as plt
from beeswarm import *
import numpy as np

d = np.array([0,1,2,3,4])
beeswarm([d])
plt.show()