Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Mon Nov 20, 2023 7:39 pm

from spire.pdf import *
ModuleNotFoundError: No module named 'spire.pdf'; 'spire' is not a package

pip installs correctly on linux as well as windows.

farhanthakur
 
Posts: 3
Joined: Mon Nov 20, 2023 5:48 pm

Tue Nov 21, 2023 5:38 am

Hello,

Thank you for your inquiry.
Based on the information provided, I have not been able to replicate the issue you mentioned during testing. Please confirm whether the installation of Spire.Pdf through PIP (pip install Spire.Pdf) was successful. Additionally, kindly check your Python directory's Lib folder to ensure the presence of the 'spire' and 'pdf' folders as depicted in the screenshot.
screenshot.png


Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Nov 21, 2023 6:14 am

spire.pdf.png
Yes the pip installation was successful and the directory is as described.
This happens on windows as well as linux.
the __init__.py in the spire folder always shows 0 kb as the file size though even after reinstallation.

farhanthakur
 
Posts: 3
Joined: Mon Nov 20, 2023 5:48 pm

Tue Nov 21, 2023 8:57 am

Hello,

Thank you for providing the information.
After conducting an investigation, I have found that the cause of the program error is the filename of your Python file, "spire.py." I have logged the issue into our bug tracking system with the ticket number SPIREPDF-6403. Our development team will investigate and fix it. Once it is resolved, I will inform you in time. Sorry for the inconvenience caused.
Additionally, during my testing, I discovered that changing the Python file name to something else, such as "Test.py" resolved the issue. Therefore, I recommend that you first modify the Python file name and then test it again.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Nov 21, 2023 3:51 pm

yes it works if I rename the file.
In fact if spire is even included as a part of the filename it gives this error, like spireExtract.py

farhanthakur
 
Posts: 3
Joined: Mon Nov 20, 2023 5:48 pm

Wed Nov 22, 2023 1:55 am

Hello,

Thank you for your feedback.
I'm glad to hear that the issue has been resolved.
Regarding the problem you mentioned with the Python project named "spireExtract.py," I conducted some initial testing, but I was unable to reproduce the issue you described. The execution results are as follows:
result.png


Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.PDF

cron