我使用anaconda环境安装了pymeep。不幸的是,当我使用Spyder尝试使用meep中的Vector3类运行时,我得到了错误:
AttributeError:模块'meep‘没有特性'Vector3’
有谁知道怎么解决这个问题吗?我已经尝试使用推荐的环境:
conda create -n mp -c chogan -c defaults -c conda-forge pymeep毫无用处。
我使用的代码是来自here:的第一个教程/示例
import meep as mp
cell = mp.Vector3(16, 8, 0)
geometry = [mp.Block(mp.Vector3(1e20, 1, 1e20),
center=mp.Vector3(0, 0),
material=mp.Medium(epsilon=12))]
sources = [mp.Source(mp.ContinuousSource(frequency=0.15),
component=mp.Ez,
center=mp.Vector3(-7,0))]
pml_layers = [mp.PML(1.0)]
resolution = 10
sim = mp.Simulation(cell_size=cell,
boundary_layers=pml_layers,
geometry=geometry,
sources=sources,
resolution=resolution)
sim.run(until=200)发布于 2019-06-24 22:53:52
我也遇到了同样的问题,一旦我开始使用python2而不是python3,一切都能正常工作。
https://stackoverflow.com/questions/52871023
复制相似问题