0
我在我的簡單Python代碼中得到'module' object has no attribute 'Vector3'
錯誤。Vector3 in Meep in Python
這是rightAngle.py
文件
import meep as mp
import math
cell = mp.Vector3(16, 8, 0)
geometry = [mp.Bloack(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
使用Compling:
python rightAngle.py >& rightAngle.out
並得到這樣的輸出:
Traceback (most recent call last):
File "rightAngle.py", line 4, in <module>
cell = mp.Vector3(16, 8, 0)
AttributeError: 'module' object has no attribute 'Vector3'
我做的是給定的代碼複製並粘貼此相當可靠source但在Vector3
對象中出現錯誤。
Python版本:
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
我不知道我錯過了什麼?
MEEP文件:試圖用它在Ubuntu 16.04 https://meep.readthedocs.io/en/latest/Python_Tutorials/Basics/
我已經嘗試了許多相關的解決方案,但沒有運氣。 – Rahul
「meep」文檔在哪裏? 'Vector3'? – hpaulj
@hpaulj我已經添加了Meep文檔源。 – Rahul