Issues running a package only in replit

Hi Yall! So I’m trying to use a package but ran into an issue described on a github issue.

tldr; I ran into an ImportError on replit. Running the exact same code on PyCharm doesn’t yield the same error (Same Python version). After looking at the package files, I noticed that pip didn’t install the same file as in replit despite being the same version.

Repl link:

from profanity_check import predict, predict_prob
#^^^ Import error here

  'predict() takes an array and a 1 for each string if it is offensive, else 0.',
  '**** you',

  'predict_prob() takes an array and returns the probability each string is offensive',
  'go to ****, you ****',

Any help would be great. Thanks!

package URL:

Sry couldn’t link it in the original post (Replit has a new user 2 link limit)

The person on the GitHub page has helped me solve the issue. Turns out replit was importing packages incorrectly, mixing and matching between 2 different packages (The original, and the drop in replacement, with the same import name, of the original which I intended to use)

No further action is needed.

1 Like

Adding on, you can disable guessing imports by adding this line to your .replit:

disableGuessImports = true
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.