python - Python3循环库导入(模块未定义)
问题描述
我正在构建一个 python 库,但似乎无法解决这个相当微不足道的导入错误。我的文件夹结构如下:
./examples/somecode.py
./library/code/specific/__init__.py and other files for this submodule
我的 somecode.py 看起来像
from library.code import specific
... do things with specific ...
我得到特定的未定义错误。
但前提是我在示例文件夹中。有趣的是,如果我从 ./ 文件夹启动解释器,代码就可以工作。
我究竟做错了什么?
编辑:
该库是使用 python3 setup.py install 安装的
解决方案
推荐阅读
- c - 如何在 8 个 LED 板上以二进制计数 - PIC
- java - 按下 Enter 后 JavaFX 切换文本字段
- python - 如何对 pandas.DataFrame 上的滚动列表理解进行矢量化
- python - 如何知道在numpy中沿轴进行操作的轴?
- python - 叶地图不作为 .py 文件打开
- swift - tableView 中的多个条目
- xml - 不使用 sql:variable 将节点插入 XML
- sql-server - 如何在 SQL Server 中使用 NOT IN 创建筛选索引
- drupal-7 - Drupal 7 theme_image src 来自绝对 uri 的绝对路径
- java - 从 Java 程序中获取任何类的源代码