Closed GIider closed 10 years ago
Hi,
I ran into the same issue with import various things, such as multiprocessing. I've temporarily fixed this by catching the AttributeError:
try:
m = getattr(m, component)
except AttributeError:
pass
However I don't know much about the internals yet. It seems to continue working for me.
I'm afraid I can't reproduce this problem as described. Can you tell me which version of the code you're using?
Also, I suppose this could be related to the Windows environment in some way. I don't have easy access to a Windows machine at the moment. Maybe you could try this is a Unix-like machine to see if the problem also occurs there?
I just tried it again with the latest version on Github and Python 3.3.0. Still throws the same error:
C:\Users\Glider\Desktop\test>python main.py
Traceback (most recent call last):
File "main.py", line 4, in <module>
File "C:\Users\Glider\Desktop\test\reloader.py", line 158, in _import
File "C:\Users\Glider\Desktop\test\folder_a\__init__.py", line 1, in <module>
File "C:\Users\Glider\Desktop\test\reloader.py", line 166, in _import
AttributeError: 'module' object has no attribute 'path'
I will try this on one of the Linux boxes at work tomorrow and report back.
I think I was able to figure out what was going on. Please have a look at the latest code and let me know if it solves the problem on your end, too.
It works now, many thanks!
I have the following structure:
The init.py contains the following code:
from os.path import dirname
main.py has this:Running main.py fails: