Python - Necesito saber porque salta esta Exceptions No module named PacienteDAL

 
Vista:

Necesito saber porque salta esta Exceptions No module named PacienteDAL

Publicado por BlueSkull (2 intervenciones) el 27/01/2016 21:43:45
Estimados estoy programando una aplicacion windows con SharpDevelop y IronPython en windows 7, y me aparece esta exceptions y no se a que se debe:

1
2
3
4
5
6
7
IronPython.Runtime.Exceptions.ImportException: No module named PacienteDAL
en Caller.Call
en BuiltinFunctionCaller<System.__Canon,System.__Cano n,System.__Canon,System.__Canon,System.__Canon,Sys tem.Int32>.Call5
en System.Dynamic.UpdateDelegates.UpdateAndExecute7
en IronPython.Runtime.Importer.Import
en IronPython.Runtime.Operations.PythonOps.Initialize Module
en PythonMain.Main

Mi proyecto:
2016-01-27%2012_22_00-Greenshot%20capture%20form
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 2.239
Plata
Ha mantenido su posición en Python (en relación al último mes)
Gráfica de Python

Necesito saber porque salta esta Exceptions No module named PacienteDAL

Publicado por xve (1646 intervenciones) el 28/01/2016 08:51:59
Segun el error, no encuentra el modulo PacienteDAL al hacer el import...

En principio, tal como muestras la estructura parece que esta bien... donde realizas la llamada?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Necesito saber porque salta esta Exceptions No module named PacienteDAL

Publicado por mcarraar (2 intervenciones) el 28/01/2016 17:21:01
Estimado asi solucione el problema, no se porque internamente no me funciono el import que utiliza por debajo ironpython o el sharpdevelop. Existira otra forma? o sera problema del IDE.

1
2
3
4
import sys
ruta = "C:/Users/.../SharpDevelop Projects/IronWinFormsApp/DAL/bin/Debug"
sys.path.append(str(ruta))
import PacienteDAL

Y la clase completa:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class PacienteBLL(object):
	"""Abstraccion de los objetos paciente."""
	def __init__(self, rut, nombres, paterno, materno, dia, mes, year):
		self.rut = rut
		self.nombres = nombres
		self.paterno = paterno
		self.materno = materno
		self.dia = dia
		self.mes = mes
		self.year = year
 
	def rut(self):
		return self.rut
 
	def nombres(self):
		return self.nombres
 
	def paterno(self):
		return self.paterno
 
	def materno(self):
		return self.materno
 
	def dia(self):
		return self.dia
 
	def mes(self):
		return self.mes
 
	def year(self):
		return self.year
 
	def IngresarPacienteBLL(self):
		r = str(self.rut)
		n = str(self.nombres)
		a = str(self.paterno+" "+self.materno)
		f = str(self.dia+"-"+self.mes+"-"+self.year)
 
		import sys
		ruta = "C:/Users/.../SharpDevelop Projects/IronWinFormsApp/DAL/bin/Debug"
		sys.path.append(str(ruta))
		import PacienteDAL
 
		from PacienteDAL import PacienteDAL
		paciente2 = PacienteDAL(r, n, a, f)
		msg = str(paciente2.IngresarPacienteDAL())
		return msg
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar