Inspect Code failing to resolve absolute references within a package

I'm inspecting one of my packages, and it's failing to resolve internal references.

For a set of files:

package/__init__.py

package/mod1.py

package/subpackage/__init__.py

package/subpackage/mod2.py

In mod1.py, I am attempting to import stuff from mod2.

from package.subpackage.mod2 import someclass

Inspections insist that “package” is an unresolved reference. Am I configuring something wrong?

 

0
6 comments
Hi, the structure looks correct. Could you provide a minimal project sample to reproduce the issue?
You can use uploading service at https://uploads.jetbrains.com/ , and provide upload ID in your reply.
0

I think I've corrected this. 

What I did was:

  • exit PyCharm, 
  • delete the .idea directories, 
  • re-open PyCharm
  • set src directories as Source Roots
  • restart PyCharm

I'll ping again if this issue resurfaces.

0

It looks like the Python package manager is broken. When viewing installed packages on the package manager, it will list packages, and can identify that packages have a higher version, but there is no menu to allow upgrade or uninstall. It's possible that this is due to referencing a local PyPi installation, but I would like instructions for figuring out where it's locking up.

PyCharm 2023.3.4 (Professional Edition)
Build #PY-233.14475.56, built on February 25, 2024
Runtime version: 17.0.10+1-b1087.17 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.6.4
GC: G1 Young Generation, G1 Old Generation
Metal Rendering is ON
Registry:
 debugger.new.tool.window.layout=true
 ide.experimental.ui=true
Non-Bundled Plugins:
 com.intellij.ideolog (222.3.2.0)
 org.jetbrains.plugins.hocon (2023.1.0)
 org.sylfra.idea.plugins.linessorter (1.0.1)
 net.seesharpsoft.intellij.plugins.csv (3.3.0-233)
 org.exbin.deltahex.intellij (0.2.9)
 

0

It should show a “link” to upgrade the package when clicked.

Is it working for you?

0

No, it isn't. The details of the package should also appear to the right of the pane, but it remains empty.

0
Hmm, I'd like to check the logs. Could you please provide logs from **Help | Collect Logs and Diagnostic Data** after reproducing the issue? You can use the upload service I mentioned above.
1

Please sign in to leave a comment.