-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import error #5
Comments
I meet same problem: Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PDFDocument
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PDFDocument
|
Hrm... ok, I'll look into this. |
I was able to Also affects opensyllabus |
Thanks for the workaround. |
Okay, I've added a This hasn't been uploaded to PyPI yet. |
Ideally, Slate would grab the correct version of PDFMiner when the user installs Slate from PyPI. See http://www.scotttorborg.com/python-packaging/dependencies.html. |
Thanks @morninj. Specifying an exact version in |
Closing as I've actually decided that Please reopen if this is |
Received an email about this issue. Perhaps we should force a specific version?
Will reopen issue for a few months and will wait for feedback. |
The issue still persists, even after upgrading the slate and pdfminer. Any updates ? |
+1 |
@rajat4493 @imichaeldotorg Could you two try If not, could you please report the version number of your PDFMiner package using the following: >>> import pdfminer
>>> pdfminer.__version__
'20140328' |
Still does not work for me. I created a fresh Ubuntu 14.04 environment, upgraded PIP, and ran
pdfminer wasn't installed as part of the pip process, so I installed it.
After installing pdfminer, I tried importing slate again:
I also verified pdfminer is the version you listed above:
|
Commenting to say I am also having the ImportError with a completely fresh pip, Python 2.6, PDFMiner, and slate install. Are there any current known workarounds, such as the one previously posted? |
same here |
Tried the workaround above but it's not working for me either on python 2.7.11 (OSX 10.11. El Capitan) Python 2.7.11 (default, Dec 5 2015, 14:44:53)
...or on 2.7.6: (OSX 10.10.3 Yosemite)
Those are different machines, but I had this working on the El Capitan machine before |
I'm also getting this. My set up is Windows 7, with a Conda install of Python 2.7.
If I try import slate I get:
|
I got the same error and eliminated it by going back to pdfminer==20100104. But then it gave me another error when I tried to use slate.PDF, so I switched to pdfminer==20100424 and was able to get text from a pdf. I don't know if there is a newer pdfminer that works, but this was my workaround. |
Same here, also on El Capitan, and with fresh pip installs of pdfminer (pdfminer-20140328) and slate (slate-0.3)
|
Same here. El Capitan, pdfminer (pdfminer-20140328) and fleshly installed slate. In [11]: import slateImportError Traceback (most recent call last) /Library/Python/2.7/site-packages/slate/init.py in () /Library/Python/2.7/site-packages/slate/slate.py in () |
This error seems to still exists, at least if you use pip to install. I think it has to do with an out of date setup.py file at pypi, as pip installs version 0.3 even though the latest version is 0.5.2. Version 0.3 doesn't have the changes to the import statements that rectify things. Some of the verbose output from pip:
|
tried installing from pip resulting in the same condition(s) as mentioned above. Then, pulled down the slate-master.zip and ran setup.py. --Finished processing dependencies for slate==0.5.2 --Best match: pdfminer3k 1.3.0 |
Hi all, Not sure if editing the slate.py is an option for people's environment, but if you change line 3
to
line 38
to
comment out lines 40 & 41 line 49
to
it works. Here are the versions of libraries I am using
|
Install slate using the setup.py file from the repository instead of PyPI. Even though PyPI claims to have version 0.5.2, it installs 0.3 instead. You can verify this by checking the version of slate installed using the following command |
@rishabh-joshi slate installed by pip was 0.3. Got it resolved by following,
That might help someone else also. |
in windows i don't have git installed, i downloaded the zip, cd in master and run "python setup.py install" |
UPDATE: slate does only support Python 2. Python 3.5.1
"Resolution":
|
For me, isn't work :/ If I do this:
|
@benjaminweb in Edit: I'm on Windows 10 Professional using Python 3.5.2 |
@benjaminweb A little supplement for @gileadslostson's answer. Try to change Also, the sample code might come across a 'UnicodeDecodeError' when executing Hope it helps : ) |
For both python2 and python3 I receive an import error In [1]: import slate
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-6c5d1974407e> in <module>()
----> 1 import slate
/home/sayth/.pyenv/versions/3.5.2/lib/python3.5/site-packages/slate/__init__.py in <module>()
46 #along with slate. If not, see <http://www.gnu.org/licenses/>.
47
---> 48 from slate import PDF
ImportError: cannot import name 'PDF' It doesn't matter which PDFminer I use either i started with this one https://github.com/euske/pdfminer received the error so install this one and still got error. https://github.com/goulu/pdfminer Note with the second I used python3 setup.py install. |
@gileadslostson @xgeric @benjaminweb
BUT, now there is a new error:
This is on Windows 7, Python 3.5.2, slate 0.5.2. Any suggestions? |
@dogfloss do you know if you uninstalled correctly? As a workaround, if you try |
@rdpickard 🥇 |
Windows 10 Enterprise 64-bit
|
@dogfloss @timClicks
This is on Windows 10, Python 3.5., slate 0.5.2. Any suggestions? |
@wongomao bump^ |
@shyamiitk I had the same issue and I solved it by editing In
to
and lines 69-72:
to
I use Windows 10, Python 3.6.2 and Slate 0.5.2, and it seems to work fine now. |
@canguezelhan I initially thought your code did the trick but after running into another error later (to do with reading unicodes) I have found that the original code worked provided I read the file in as binary to begin with using. |
Just to clarify - (1) This library has been unusable for 3+ years due to unresolvable dependency issues. (2) Even when it works, this library only supports Python 2.7. |
I have the same problem. My friend can use this code without any errors . He told me he didn't install anything. When i installed packages i get more errors idk |
@sfsdfd There exist working forks of this repo. A script using slate is spitting out text from a PDF as I type. Check https://github.com/alkivi-sas/slate/tree/python3 |
@canguezelhan I have the same problem. Silly question but how can I find the |
@canguezelhan hi, thank you for your response. I just installed slate (before I only installed |
@BadrulAlom Hi, I was doing the same thing (i.e. opening the file as binary using |
Worked for me. |
python 3.11 - still getting this error: cannot import name 'PDF' from partially initialized module 'slate' |
When trying to import slate, the following error message occurs. pdfminer and slate have been installed via pip.
Using Windows XP and Python 2.7
Looking at the pdfminer website, i found the following command that works:
Maybe pdfminer changed their API?
The text was updated successfully, but these errors were encountered: