Wednesday, 15 May 2013

python - Strange NameError: name 'math' is not defined, while "import math" -


I get the NameError when executing this code. It's weird because the import math in code is the import math in sigma module ... maybe it's a kind of conflict? Thanks for your time!

  file: c: \ user \ greenmen \ document \ python script \ sigma_crit.py ", line 21, sigma_crit # Simplified MC in NameError: name is not 'math' defined  Import Sigma as SGM # module as "import math" in sigma as well as import math diff sigma_eded (sigmax, sigma, sigmaz, theta, pw, pry, NUU, alpha, NO): "" "Important stress calculation for one of the three failure criteria Return value No. 1 - Simplified seal-coilbo 2 - Sealer-Qulbo 3 - List with the Drucker-Prag 4-3 model, SigmaX - Strain X Wellbor axis in Sigmaii - Y Wellbor Axis Strain - Thatta - Ezimath, SHMX Antiglow - POSON ratio alpha-biot coefficient from NUI "" "sigma_tethheka = sgm.sigma_calc (sigmax, sigmai, sigmaz, theta, pw, pre, new, alpha, 1) sigma_zi = sgm.sigma_calc (sigmaax, sigma, sig Mass, Theta, PW, Press, New, Alpha, 2) Sigma_Stie = sgm.sigma_calc (sigmaax, sigma, sigmaz, thita, pw, press, new, alpha, 3) # degrees for radians for the equations below. Built on carefully above the function, converter theta = mathematics. Rebels # Simplified MC  

You stale bytecode You have changed the source file but have not restarted Python.

You can see it from traceback;

But your traceback shows the comment on next . Em> line; The bytecode reference is clearly old and you have changed the code.


No comments:

Post a Comment