Repository navigation
Find RDKit's Contrib directory on Windows - #3
Open
marc-lehner wants to merge 1 commit into
Open
marc-lehner wants to merge 1 commit into
marc-lehner wants to merge 1 commit into
Conversation
The descriptors node imports SA_Score and NP_Score from RDKit's Contrib directory, which it expected under <prefix>/share/RDKit/Contrib. conda installs it there on Linux and macOS, but under <prefix>/Library/share/RDKit/Contrib on Windows. On Windows the import failed, and with it the whole extension: KNIME showed none of its nodes. Try both layouts relative to sys.exec_prefix, then RDConfig.RDContribDir. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows the extension loads no nodes.
rdkit_descriptors.pyimportsSA_ScoreandNP_Scorefrom RDKit's Contrib directory, which it expected under<prefix>/share/RDKit/Contrib. conda puts it there on Linux and macOS, but under<prefix>/Library/share/RDKit/Contribon Windows. The import fails, and with it the whole extension:The fix tries both layouts relative to
sys.exec_prefix, thenRDConfig.RDContribDir, the documented way to reach Contrib (see rdkit/rdkit#2279).RDConfigstores the prefix from install time, so it is only the fallback for an environment that was moved;rdkit.Chem.Descriptorsalready imports it. On Linux and macOS the first path is the one used so far, so nothing changes there.Verified on Windows (KNIME Analytics Platform 5.12, RDKit 2025.09.6 from conda-forge):
NP_Score, andSA_Scoreloads fromLibrary\share\RDKit\Contrib.The same commit is in the knime-community fork for the release lines: knime-community#9 (master), knime-community#10 (releases/5.13) and knime-community#11 (releases/5.12).
🤖 Generated with Claude Code