![pycharm import module pycharm import module](https://daynhauhoc.s3-ap-southeast-1.amazonaws.com/original/3X/2/6/26e3fa3bdcc4cd25770ebb9041f802f068e3d811.png)
way better than this band-aid of mine i refrained from moving around dlls as i think i noticed some stuff using those dlls that are at the same time python extensions. As imported module name is really obvious only at runtime IDE can not know what native module is actually returned under the different name. problem with panda3d.py is that native module names are imported using strings. IDE probably imports native extension and enumerates exported symbols somehow.
Pycharm import module code#
Regarding code completion: i do not know for a fact, but im making an educated guess here. the way i see it is pandac.PandaModules still doing the heavy lifting of loading stuff but rest of whats inside my panda3d module just conveniently exposes rest of stuff. without stuff in preloader (by the way purpose of preloader is to hide whatever is imported in there) app throws errors like “Attempt to register type TypedWritable more than once!”. Thing with preloader - i was just emulating what original panda3d.py did. Whole purpose of direct/ init.py and others was to seamlessly rename native module to name that is exposed by panda3d by default.
![pycharm import module pycharm import module](https://support.foxtrotalliance.com/hc/article_attachments/360025203212/2019-01-18_10-14-23.png)
Code completion for imported module libp3direct works just fine though. problem is python expecting exported initdirect(), but dll providing initlibp3direct(). i tested with libp3direct.dll and renamed it to direct.pyd. Problem with symlinking existing dlls to panda3d is changing module name. Can not wait to hear everyone’s opinions. In this instance i believe it is exactly what happened - blown off feet. So - maybe it is a good idea to do away with panda3d.py magic and just import things official way? We all know python gives us a shotgun and it is our responsibility to not shoot ourselves in the foot with it. It still needs some guidance for supporting code completion for new builtins but thats not panda’s fault. Except it now shows code completion in pycharm with ease. With some python magic i came up with my own p3d module that replaces panda3d and does same job.
Pycharm import module full#
So far so good - now i can import those modules directly and see full code completion. Made symbolic links of each dll that panda3d.py imports linking them to same filename except with. In eclipse it can be mitigated a little with predef files, but pycharm does not bend to my will yet. And panda3d.py takes half of that from user by disrupting proper support for code completion. One of core python values is rapid development. Thing is - imo panda3d.py creates more problems than it solves. Of course it merges few modules together - cosmetics. Essentially same would be achieved if we had panda3d folder on PYTHONPATH and appropriately named binary modules with. I was wondering… what problem does panda3d.py module loader solves? It just loads binary modules and serves them.