-
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
Fix slate for Python 3.4+ #32
base: master
Are you sure you want to change the base?
Conversation
Fix both unit test files so that they can be run with python (not only py.test) from any directory.
|
src/slate/classes.py
Outdated
if PYTHON_3: | ||
import slate.utils as utils | ||
else: | ||
import utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bad way to fix the problem. Just use from . import utils
, which works on both versions of python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Thanks for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your latest patch has an extra space, but otherwise looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talking about extra spaces, I can fix some style issues in classes.py using pycodestyle. Is it OK for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... it goes beyond the scope of this PR though
Hi ! any update on this? I'm facing problems while installing on python 3.6 |
I import slate in anaconda python 3.5 environment, with the slate and pdfminer.six package have been installed. Then the following ImportError emerged, so how can I fix it?
|
Adding to what @benjaminweb said, #26 and #29 also fix the same |
This PR has some problems, too; read along... So I'm trying to try out various Python (Python 3) PDF handling libraries, but slate was too good for me to try out the other ones. Of course, except for the fact that it didn't work with Python 3.6. I am on the latest macOS, using the latest (as of today) Python 3.6.4. I tried installing slate the normal way through
I tried installing the repo directly as @karoldvl in #38 had mentioned, but to no avail, resulting in the same dependency error. I went through all the issues and PRs present in the repo, and this PR seemed to be the most active, most recently. So I went ahead and tried it, but I ended up with the same error as before. I can't tell if @aron-bordin is mentioning the same issue, but hope this helps. Then I found a fork of @rtouze's fork(!), here. And interestingly this one fixes the damn I would suggest that @rtouze, one way or another, apply the changes in the @alkivi-sas repo. Until then, running
installs a working fork of slate (currently). Cheers. |
setup.py
Outdated
@@ -23,7 +23,7 @@ | |||
packages=find_packages('src'), | |||
package_dir={'': 'src'}, | |||
requires=[pdfminer], | |||
install_requires=['distribute', pdfminer], | |||
install_requires=[pdfminer], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I had no idea timClicks/slate had a fix for this issue already—link—I see now that this causes conflicts. 'setuptools'
should be used; though I don't think this is an urgent problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I let the people in charge of the project choose the right solution :-)
@rtouze: Reasons for closing? |
I opened this 4 years ago... Is the project still maintained? |
I faced some issues while using slate with Python 3.4 and 3.5. It is due to the differences in relative import between python 2 and python 3 which lead to an error in classes.py.
I also updated the tests, the readme and setup.py.
I did not take time to test with Python 2.7 and Python 3 releases prior 3.4 though.
I hope you'll be able to merge. BTW, thanks for your work on this lib!