How to install local package #2349
-
Hi, I'm trying to locally install a package in the src folder. At the simplest, this would look something like the
This seems to me to be the way it should work based on the docs. What am I doing wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
There is no |
Beta Was this translation helpful? Give feedback.
-
I could still use some help here. I'm afraid I'm missing some very basic knowledge. My projectfolder has this structure:
Now. The file
While the file Can someone explain what I'm missing? I tried:
And some other pdm add commands. The 'pdm add' like commands give errors like this:
Or
I also tried adding to my pyproject.toml
This gives the [RequirementError] when I do What does work is adding the
But to me that looks like a workaround instead of a solution. Are there any more robust and pythonic PDM ways to use the code that is located in a folder from within a file that is itself located in another folder? |
Beta Was this translation helpful? Give feedback.
There is no
pyproject.toml
insrc/example_package
, so no Python installation tool would know how to install it. If you want to list a local package as a dependency of your project, you can indeed usepdm add
, but you have to point it at the root folder which containspyproject.toml
. Also, you don't need to add the current project as a dependency of itself! In your case I believe you can just runpdm install
.