Problem installing local package in PyCharm
Hello,
I am running PyCharm 2025.2 on Windows 11 Pro. I am testing and trying to understand how to create and use local packages in my projects. I use virtual environments, and I would like to install packages into that environment.
I have a basic test project into which I am trying to import a test package created using Hatchling. The package is located in another directory. The package directory includes the dist-folder with tar.gz and .whl files.
I am unsuccessful in installing this package using the built-in package manager of PyCharm. I am following the instructions here:
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html#install=package-from-disc
I have tried giving the top level package directory as well as the .gz and the .whl files as parameters for the Path. But nothing happens - no error message and no package is installed.
I can successfully install the same package into the environment using the terminal! And then I can also see it in the package manager listing of installed packages. So that seems normal.
Why is the package manager's “Install from Disk…” option not working?
Thank you for any insights and suggestions,
Rainer
EDIT: By installing the package through the terminal, I got it working fine with the test program. But when I tried to install it into a production project in the same, identical way, Python can't find the module - it gives an error message immediately when trying to import it. I have double-checked that I have installed it into the correct environment, and it can be found in the site-packages directory. Have also re-started PyCharm a number of times and tried installing it both as an editable and non-editable package.
Error message:
File "label_and_height_objects_cmd.py", line 24, in <module>
import example_package_rba
ModuleNotFoundError: No module named 'example_package_rba'
PyCharm installation details:
PyCharm 2025.2
Build #PY-252.23892.439, built on August 4, 2025
Source revision: e7a5644c801f1
Runtime version: 21.0.7+6-b1038.58 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 4064M
Cores: 32
Registry:
ide.experimental.ui=true
Non-Bundled Plugins:
org.jetbrains.plugins.yaml (252.23892.464)
com.intellij.properties (252.23892.464)
org.jetbrains.completion.full.line (252.23892.458)
com.intellij.copyright (252.23892.464)
com.intellij.notebooks.core (252.23892.464)
org.editorconfig.editorconfigjetbrains (252.23892.464)
org.toml.lang (252.23892.464)
com.jetbrains.restClient (252.23892.464)
com.intellij.swagger (252.23892.464)
intellij.jupyter (252.23892.464)
Docker (252.23892.515)
com.github.srwi.pixellens (0.4.3)
org.jetbrains.plugins.github (252.23892.515-IU)
org.jetbrains.plugins.gitlab (252.23892.515-IU)
com.github.copilot (1.5.53-243)
org.jetbrains.security.package-checker (252.23892.464)
com.intellij.microservices.ui (252.23892.464)
帖子评论已关闭。
Hi Rainer Bars , this issue requires thorough investigation. Please check if the issue persists in the latest 2025.2.0.1 release. If updating doesn’t resolve the problem, please create a new issue in YouTrack (https://youtrack.jetbrains.com/issues/PY) and include all relevant details, ideally with a minimal reproducible sample project. This will help us to analyze and resolve it more quickly.