ViSa
ViSa

Reputation: 2247

pdftotext in python not working missing dll probably

I was able to use pdftotext earlier after a alot of challenges in installation few months back and at that time if I remember correctly I did downloaded some files and placed it some folder and did sudo commands for installation and modified content in Micros. Visual Studio.

But recently I deleted my Anaconda and reinstalled and since then I am getting this message importerror-dll-load-failed-the-specified-module-could-not-be-found even when it shows pdftotext=2.2.2 installed in my environment.

then after reading in some post I did pip installation of lower version of pdftotext but was still getting the error so I reinstalled pip install pdftotext==2.2.2

Now the strange thing is I am able to run this library in Jupyter Notebook but when I run this library in streamlit app on localhost then it gives the error import pdftotext ModuleNotFoundError: No module named 'pdftotext'

And when I terminate the streamlit app by ctrl+c then in logs I can see:

forrtl: error (200): program aborting due to control-C event
Image              PC                Routine            Line        Source
libifcoremd.dll    00007FF85CBBDF54  Unknown               Unknown  Unknown
KERNELBASE.dll     00007FF90221D65D  Unknown               Unknown  Unknown
KERNEL32.DLL       00007FF902FAE8D7  Unknown               Unknown  Unknown
ntdll.dll          00007FF904E5FBCC  Unknown               Unknown  Unknown

In some old post I have seen using pip3 for installation but I am not sure if that's still relevant or not. To me it seems like either some DLL issue or multiple python interpreter issue.

I am using Windows 11 with WSL enabled and Anaconda, vscode, python 3.12.4

After removing Anaconda I started facing Power Shell execution policy Restricted issues which was not letting me activate virtual environments link which I thought I fixed it and then installed Anaconda again.

Can anyone suggest what could be done here to fix it ?

Update: My packages are getting installed in this anaconda environment which is correct as I am running it from here only. C:\Users\vinee\anaconda3\envs\HQ2\Lib\site-packages

But I think streamlit is still picking up my packages from the Global environment Python (which I deleted yesterday) and libraries still exist at this path C:\Users\vinee\AppData\Roaming\Python\Python312\site-packages

I am just gonna delete this folder & subfolders Python312\. Although I am not sure if this will work or not or do I need to remove some path variables. Please suggest !!

Upvotes: -1

Views: 78

Answers (2)

ViSa
ViSa

Reputation: 2247

I found traces of Global Python312 even after deleting from windows by add or remove programs at locations C:\Users\vinee\AppData\Roaming\Python\Python312\site-packages and C:\Program Files\Python312.

I have removed Python312 folders from both of these locations. Checked my environment variables system paths and they all look clean and gave a restart.

This has fixed mostly everything and may need to check packages in anaconda environment now.

Posting it as answer as that will close this Post instead of deleting it or adding as comment.

Upvotes: 0

Diego Torres Milano
Diego Torres Milano

Reputation: 69388

From the same environment where you are running streamlit do

$ python3 -V # verify it's what you think
$ python3 -m pip install pdftotext==2.2.2
$ streamlit run ...

Upvotes: 0

Related Questions