无法用诗歌指定父母文件夹中的依赖性
我有以下文件层次结构:
./
├── abc
│ ├── pyproject.toml
│ ├── main.py
│ └── xyz
│ ├── __init__.py
│ └── other.py
└── common-lib
├── pyproject.toml
└── common
├── __init__.py
└── lib1.py
在pyproject.toml
abc
的文件中,我似乎无法将common-lib
作为依赖关系我尝试。一个例子如下。我检查了许多类似的问题。
[tool.poetry]
packages = [{ include = "common", from = "common-lib" }]
[tool.poetry.dependencies]
common-lib = { path = "../common-lib", develop=true}
我收到以下错误。
Updating dependencies
Resolving dependencies...
Package operations: 1 install, 0 updates, 0 removals
• Installing common-lib (0.1.0 somePath/common-lib)
ModuleOrPackageNotFound
No file/folder found for package common-lib
at ~\AppData\Roaming\Python\Python310\site-packages\poetry\core\masonry\utils\module.py:63 in __init__
59│ "from": str(src.relative_to(self._path)),
60│ }
61│ ]
62│ else:
→ 63│ raise ModuleOrPackageNotFound(
64│ "No file/folder found for package {}".format(name)
65│ )
66│
67│ for package in packages:
您能帮我解决这个问题吗?
I have the following file hierarchy:
./
├── abc
│ ├── pyproject.toml
│ ├── main.py
│ └── xyz
│ ├── __init__.py
│ └── other.py
└── common-lib
├── pyproject.toml
└── common
├── __init__.py
└── lib1.py
In pyproject.toml
file of abc
, I cannot seem to add common-lib
as a dependency no matter how I try. One example is as below. I checked many similar questions.
[tool.poetry]
packages = [{ include = "common", from = "common-lib" }]
[tool.poetry.dependencies]
common-lib = { path = "../common-lib", develop=true}
I receive the following error.
Updating dependencies
Resolving dependencies...
Package operations: 1 install, 0 updates, 0 removals
• Installing common-lib (0.1.0 somePath/common-lib)
ModuleOrPackageNotFound
No file/folder found for package common-lib
at ~\AppData\Roaming\Python\Python310\site-packages\poetry\core\masonry\utils\module.py:63 in __init__
59│ "from": str(src.relative_to(self._path)),
60│ }
61│ ]
62│ else:
→ 63│ raise ModuleOrPackageNotFound(
64│ "No file/folder found for package {}".format(name)
65│ )
66│
67│ for package in packages:
Could you help me solving this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在
pyproject.toml
中设法通过以下设置解决了问题。I managed to solve the issue with the following settings in the
pyproject.toml
.