{"action":"opened","issue":{"url":"https://api.github.com/repos/mwclient/mwclient/issues/99","labels_url":"https://api.github.com/repos/mwclient/mwclient/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/mwclient/mwclient/issues/99/comments","events_url":"https://api.github.com/repos/mwclient/mwclient/issues/99/events","html_url":"https://github.com/mwclient/mwclient/issues/99","id":112029008,"number":99,"title":"Problem with absolute imports","user":{"login":"tosher","id":2726543,"avatar_url":"https://avatars.githubusercontent.com/u/2726543?v=3","gravatar_id":"","url":"https://api.github.com/users/tosher","html_url":"https://github.com/tosher","followers_url":"https://api.github.com/users/tosher/followers","following_url":"https://api.github.com/users/tosher/following{/other_user}","gists_url":"https://api.github.com/users/tosher/gists{/gist_id}","starred_url":"https://api.github.com/users/tosher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tosher/subscriptions","organizations_url":"https://api.github.com/users/tosher/orgs","repos_url":"https://api.github.com/users/tosher/repos","events_url":"https://api.github.com/users/tosher/events{/privacy}","received_events_url":"https://api.github.com/users/tosher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-18T16:48:53Z","updated_at":"2015-10-18T16:48:53Z","closed_at":null,"body":"Hi!\r\nI have a problem with using mwclient with python3.\r\n\r\nIf i want to use **mwclient** as first level module  - all works fine.\r\nBut if use **mwclient** as second level module (and so on)  - i have erros like:\r\n```\r\n...mwclient\\__init__.py\", line 26, in <module>\r\n    from mwclient.errors import *\r\nImportError: No module named 'mwclient'\r\n```\r\nBecause of mwclient is not on top level.\r\n\r\nExample:\r\n```\r\ncli/__init__py  (is empty)\r\ncli/cligo.py\r\ncli/mwclient/\r\nrun.py\r\n```\r\nrun.py\r\n```python\r\nfrom cli import cligo\r\n```\r\ncligo.py\r\n```python\r\nfrom cli import mwclient\r\n# or\r\nfrom . import mwclient\r\n```\r\nI trying to use latest version with Sublime Text 3 where each plugin is an imported module, and mwclient in it - as a submodule (subdirectory).\r\n\r\nSome another moments with absolute imports:\r\n* http://chimera.labs.oreilly.com/books/1230000000393/ch10.html#_discussion_171\r\n\r\n```\r\nThe downside of using an absolute name, such as mypackage.A, is that it hardcodes the top-level\r\npackage name into your source code. This, in turn, makes your code more brittle and hard to work\r\nwith if you ever want to reorganize it. For example, if you ever changed the name of the package,\r\nyou would have to go through all of your files and fix the source code. Similarly, hardcoded names\r\nmake it difficult for someone else to move the code around. For example, perhaps someone wants\r\nto install two different versions of a package, differentiating them only by name. If relative imports\r\nare used, it would all work fine, whereas everything would break with absolute names.\r\n```\r\n\r\n\r\n\r\n"}}