Does PyCharm support PDM / PEP 582?



While looking at Pipenv performance issues a colleague pointed me to PDM [1] a project that aims to use PEP 582 [2], which defines a mechanism for finding packages in a project's `__pypackages__` directory.  When opening a small test project in PyCharm, PDM is not automatically detected, nor are the local packages found and made available to the IDE.

Is there any way to configure PyCharm to include the local packages for use in a project?

Thank you!





PyCharm doesn't have a feature for configuring it automatically yet. I filed a feature request to our issue tracker about proper PDM support, feel free to vote for it to help us better prioritize it.

Any directory, including the one containing those local packages, can be added to your Interpreter Paths

which will make them available to PyCharm's code insight.


Sergey Karpov thank you for filing the feature request for PDM support, hopefully JetBrains will consider and implement soon.

The __pypackages__ directory can be added to the interpreter paths — in the case of using PDM the interpreter will be a 'base' Python interpreter, not a virtual environment, so it would be that each projects' specific __pypackages__ directory would be listed in the base interpreter, is that so? This may cause issues between projects.

The other, per project, option (which is mentioned on the PDM website is to add it as a sources root.

Preferences >> Project >> Project Structure 

Mark __pypackages__/<major.minor>/lib as 'Sources'.

I have found that that works cleanly and packages installed by PDM outside of PyCharm are then immediately found in the UI.



Please sign in to leave a comment.