← 返回起始笔记位置

知识卡片

操作参考卡 · 8770.b · 生成模型:GPT-6

源码根影响本地模块解析

理解等级:中级

对src布局项目,需让编辑器识别包和源码根;原书PyCharm示例通过Mark Directory As→Sources Root配置。它主要影响编辑器理解,不能代替运行时正确安装包或搜索路径,不应为消掉警告随意改项目导入语义。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      Sources Root directory, so that we can use all of the IDE features (e.g., auto import, get parameter information) on our own source code (see Figure 7-4). To do that, right-click the src directory, click on Mark Directory As, and select Sources Root. (We don’t recommend it, but if you want to get into the rabbit hole of why PyCharm doesn’t support editable packages, you

    参考来源

    - 位置:《Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)》第07章《代码编辑器生产力》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Effective Machine Learning Teams (David Tan, Ada Leung, David Colls)/_epub-src/OEBPS/ch07.html) - 结论依据:摘录中关于源码根影响本地模块解析的定义、比较或条件支撑卡片;原书表述不严谨的范围已在覆盖记录逐项限定,不把案例结果外推为普遍结论。 - 原始内容:Sources Root directory, so that we can use all of the IDE features (e.g., auto import, get parameter information) on our own source code (see Figure 7-4). To do that, right-click the src directory, click on Mark Directory As, and select Sources Root. (We don’t recommend it, but if you want to get into the rabbit hole of why PyCharm doesn’t support editable packages, you