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

Warning on (my) Linux box #7

Closed
ospalh opened this issue Oct 28, 2012 · 2 comments
Closed

Warning on (my) Linux box #7

ospalh opened this issue Oct 28, 2012 · 2 comments

Comments

@ospalh
Copy link

ospalh commented Oct 28, 2012

I hate to rain on your parade, but when i start the 0.4.0 version on my Linux box (Fedora 17, but i guess the point is with a full Python), i get

An error occurred in an add-on. Please contact the add-on author.

/home/roland/anki-alt/addons/chinese/cjklib/util.py:51: UserWarning: Module sqlalchemy was already imported from /home/roland/anki-alt/addons/chinese/sqlalchemy/__init__.pyc, but /usr/lib64/python2.7/site-packages is being added to sys.path
  from pkg_resources import (Requirement, resource_filename,
/home/roland/anki-alt/addons/chinese/cjklib/util.py:51: UserWarning: Module httplib2 was already imported from /home/roland/work/github/anki-work/libanki/thirdparty/httplib2/__init__.pyc, but /usr/lib/python2.7/site-packages is being added to sys.path
  from pkg_resources import (Requirement, resource_filename,

As this is a warning about different versions, i guess you can just ignore this.

@ttempe
Copy link
Owner

ttempe commented Nov 12, 2012

I've added a very dirty workaround in 0.6.0: remove /usr/lib/python2.7/dist-packages from sys.path before loading cjklib. In the next release, I'm removing anything ending in dist-packages.

It seems to work here. I hope I don't break anything else. Other modules aren't supposed to rely on a local python distribution.

@ttempe ttempe closed this as completed Nov 12, 2012
@ospalh
Copy link
Author

ospalh commented Nov 12, 2012

Oh dear, oh dear, oh dear.
I see no real solution apart from telling users that have installed their own sqlalchemy or cjklib to either get rid of the system-wide versions or to use virtualenv or something like that.

For example, on my 64-bit Fedora:

frento:~> locate sqlalchemy
.
.
.
/usr/lib64/python2.7/site-packages/sqlalchemy
/usr/lib64/python2.7/site-packages/sqlalchemy/__init__.py
/usr/lib64/python2.7/site-packages/sqlalchemy/__init__.pyc
/usr/lib64/python2.7/site-packages/sqlalchemy/__init__.pyo
/usr/lib64/python2.7/site-packages/sqlalchemy/connectors
/usr/lib64/python2.7/site-packages/sqlalchemy/cprocessors.so
/usr/lib64/python2.7/site-packages/sqlalchemy/cresultproxy.so
/usr/lib64/python2.7/site-packages/sqlalchemy/databases
/usr/lib64/python2.7/site-packages/sqlalchemy/dialects
.
.
.

So,

  • For some it is dist-packages, for others site-packages
  • For some it is /usr/lib/, for others /usr/lib64/
  • A lot of people use Python 2.7, but Anki in general works with Python 2.6 as well.

That looks like it will get arbitrarily nasty.

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

No branches or pull requests

2 participants