Google-Colaboratory local module ModuleNotFoundError

偶尔善良 提交于 2020-04-18 07:00:30

问题


I have cloned a github repository into google-colab [https://github.com/limbo018/DREAMPlace] and installed the necessary requirements.

When I run the main script (!python dreamplace/placer.py) from either the base repo directory or the cmake install directory in jupyter I receive a modulenotfound error. I am able to import the module from a jupyter cell.

The placer.py script imports it's parent module (dreamplace), which I have added to the path. I have a feeling colab/jupyter spawns a separate shell when I run the program through colab/jupyter. How can I ensure that the dreamplace module is added to the global path such that placer.py and other child-scripts can find it? I would prefer not having to edit the program, but if this is the best solution, it's no problem.

Here is a link to my colaboratory which includes my steps to set up the environment [it takes a couple minutes to complete]: https://colab.research.google.com/drive/1hS42ZegFZhjO28On1Hk_1muC1opasBxA

I tried to add the dreamplace directory to the path, but it's no use.

I would appreciate any advice or help on this issue. Thanks.

Note this issue has been mentioned in the repository: https://github.com/limbo018/DREAMPlace/issues/2

来源:https://stackoverflow.com/questions/56939487/google-colaboratory-local-module-modulenotfounderror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!