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

Pygments import error #4

Open
hsingh23 opened this issue Feb 11, 2013 · 6 comments
Open

Pygments import error #4

hsingh23 opened this issue Feb 11, 2013 · 6 comments

Comments

@hsingh23
Copy link

I get this error message on launch of anki.
An error occurred in an add-on. Please contact the add-on author.

/home/user/Anki/addons/code_highlight_addon/pygments/plugin.py:39: UserWarning: Module pygments was already imported from /home/user/Anki/addons/code_highlight_addon/pygments/init.pyc, but /usr/lib/python2.7/dist-packages is being added to sys.path
import pkg_resources

@ghost
Copy link

ghost commented Mar 22, 2013

Hello Tiago, could we be lucky to have a fix, if you have some spare time? You add-on is doing great, minus the warning message that pops up every time we launch Anki2. Thank you.

@willprice
Copy link

Hi nomnex, presumably you've already got pygments installed as that's what the error indicates. I too suffered from this error until I deleted the pygments folder in the code_highlight_addon folder, this fixes the issue with it conflicting with the system pygments package.

@ghost
Copy link

ghost commented Jun 2, 2013

thanks for the feedback and sorry for the delay. if I remove the pygments folder in the addon I have another type of error message

error msg with the pygments folder:

An error occurred in an add-on.
Please post on the add-on forum:
https://groups.google.com/forum/#!forum/anki-addons

/home/mt/Anki/addons/code_highlight_addon/pygments/plugin.py:39: UserWarning: Module anki was already imported from /usr/share/anki/anki/__init__.py, but /usr/lib/python2.7/site-packages is being added to sys.path
  import pkg_resources

error message with the pygmens folder removed:

An error occurred in an add-on.
Please post on the add-on forum:
https://groups.google.com/forum/#!forum/anki-addons

Traceback (most recent call last):
  File "/usr/share/anki/aqt/addons.py", line 39, in loadAddons
    __import__(file.replace(".py", ""))
  File "/home/mt/Anki/addons/Syntax Highlighting for Code.py", line 2, in <module>
    import code_highlight_addon.code_highlight_addon
  File "/home/mt/Anki/addons/code_highlight_addon/code_highlight_addon.py", line 199, in <module>
    from pygments import highlight
ImportError: No module named pygments

@willprice
Copy link

Hi Nomnex, you have a different error to the one initially posted. In the intial post pygments has been imported twice, your first error message indicates that anki (the module) has been imported twice. What version of Anki are you running? If it's not the most recent, could you try using that?
What's the python version?

@ghost
Copy link

ghost commented Jun 3, 2013

Python 2.7.1 and anki 2.0.9 beta on Fedora Linux 15. You are right; after reading you message, I removed the anki 1.2.8 package from my distribution . I don't have this error message anymore when I start Anki 2. thank you.

@willprice
Copy link

Glad I could help!

On 3 June 2013 16:11, nomnex [email protected] wrote:

Python 2.7.1 and anki 2.0.9 beta on Fedora Linux 15. You are right; after
reading you message, I removed the anki 1.2.8 package from my distribution
. I don't have this error message anymore when I start Anki 2. thank you.


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-18847811
.

Will

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