"Import textract" won't recognise installed package via package installer

Hello I have been struggling with installing the packages needed for my app.py. I have installed the packages via ‘tools’ with the package installer. I can see the packaged as being installed. But When I run the app, it won’t find the packages.

Anyone else has this problem, or know how to fix it?

Thanks in advance!

@JoepBaks, welcome to the community!

Replit’s own package manager may be unreliable at times. I recommended you use Python’s own package manager, pip through the shell like this:

$ pip install my-module

@savardo I found the repl they were talking about, https://replit.com/@JoepBaks/caogptV2

So I forked it and I tried uninstalling the package and tried pip install textract and that didn’t work. Then, I ran this command: poetry add textract and it seemed to work in shell, I got no errors, but I received the same error as @JoepBaks


Thank you for your reply. But just as @doxr found, this command didn’t work. Could it be something in my code?

Probably not… this might possibly be a bug.

Forking seems to have the same problem. I recommend you try downloading the project as zip, upload all the files and folders in a new python project, but don’t upload the .replit file or the .nix file. Then, try running poetry add textract in the new python repl.

Thanks for your reply. Indeed it seems to install. But running app.py still gives me the module not found error with regards to textract. Could it be the way my code is set-up?

Is that regarding my other post? Please try the new one and see if it works.

this is my reaction on your latest reply with regards to downloading as a zip and importing the files via poetry add textract.

I seem to get some problems with python and the missing .nix .replit files.

fix the replit.nix file (remove line 6?)

1 Like

I forked and removed line 6 in replit.nix as @UMARismyname said.

But I realized that the .nix file looked… different from usual. So I found the official Python template and copied over the .nix file. That gave me a whole new set of annoying errors. So what I did was check the original nix file in “caogptv2” and your new version has a different nix file. I copied over the old nix file to the new nix file. I got this error [REMOVED IN EDIT]

Now, this is just plain confusing.

Edit: I did what @UMARismyname suggested. Now langchain finds itself a problem. Although I used poetry add langchain (no error was present) yet langchain cannot be found. Link to the repl: https://replit.com/@doxr/sussybaka-1

you need to copy over the .replit file from the Python template as well, to allow IDE features and solve the nix error