Skip to content
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

httplib2 is not declared as a dependency #37

Open
pganssle opened this issue Apr 23, 2016 · 4 comments · May be fixed by #39
Open

httplib2 is not declared as a dependency #37

pganssle opened this issue Apr 23, 2016 · 4 comments · May be fixed by #39

Comments

@pganssle
Copy link

When installing in a fresh virtualenv, trying to run ankiserverctl.py gives:

ImportError: No module named httplib2

I believe this is just a matter of adding httplib2 into the dependencies in setup.py. Installing httplib2 with pip fixes the issue.

@pganssle
Copy link
Author

Hmmm.. looking more closely at this, it turns out it's actually an issue with how Anki is packaged, I think:

  File ".../venv/local/lib/python2.7/site-packages/AnkiServer/apps/sync_app.py", line 34, in <module>
    from anki.sync import Syncer, MediaSyncer
  File ".../anki/anki/sync.py", line 11, in <module>
    import httplib2

Looks like the anki dependency is not explicitly declared here, and is being pulled in from the system install of anki, so the virtualenv isn't pulling in Anki's dependencies. Not sure if you want to make them an explicit dependency of this package even though they aren't used directly. Seems like a weird way to do things.

@pganssle pganssle linked a pull request Apr 27, 2016 that will close this issue
@dsnopek
Copy link
Owner

dsnopek commented Apr 27, 2016

httplib2 is meant to be bundled with the anki source code, and we shouldn't have to install it separately. How did you go about installing anki? Is the thirdparty/httplib2 directory missing from your anki code?

@pganssle
Copy link
Author

@dsnopek Yes, agreed that it should be shipping with Anki. As I mentioned in my PR, I think an alternate approach would be to mention this in the documentation about using a virtualenv.

It's been a long time since I installed Anki, but I'm on Ubuntu 15.04 and if I had to guess I probably used apt-get install anki. Looking at /usr/share/anki/anki, I don't see any thirdparty folder in there. Maybe I can spin up a clean container this weekend and try installing Anki on it fresh to see if this persists.

Not the right place to discuss it, I guess, but I think it would be nice if the library portions of anki were spun off into their own library that is distributed by PyPI. That would make packaging much nicer (since, as is, you need to install Anki separately from the install process of anki-sync-server if you are going through pip, even if you have no need for the graphical front-end).

@dsnopek
Copy link
Owner

dsnopek commented Apr 27, 2016

Ok, thanks!

Well, we bundle a copy of Anki (or at least we should be doing that - it's possible the last release got messed up?) in anki-sync-server, so if you install with pip you should have everything you need. But if that's broken too, please open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants