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

ImportError #2

Closed
Stivanification opened this issue Nov 6, 2020 · 4 comments
Closed

ImportError #2

Stivanification opened this issue Nov 6, 2020 · 4 comments
Assignees

Comments

@Stivanification
Copy link
Contributor

I run Ubuntu 20.04 with Python 3.8.5 and I installed your package using pip3. I am using Texsoup 0.3.1. On importing your package, I get an error: the command from moodlexport import Question returns

ImportError                               Traceback (most recent call last)
<ipython-input-1-b3fb367bdd98> in <module>
----> 1 from moodlexport import Question

~/.local/lib/python3.8/site-packages/moodlexport/__init__.py in <module>
      4 
      5 from .python_to_moodle import Category, Question, printmk
----> 6 from .tex_to_python import latextopython, latextomoodle
      7 
      8 

~/.local/lib/python3.8/site-packages/moodlexport/tex_to_python.py in <module>
      5 from TexSoup import TexSoup
      6 from TexSoup.data import TexNode
----> 7 from TexSoup.utils import TokenWithPosition
      8 
      9 # Given a latex question, returns a python question

ImportError: cannot import name 'TokenWithPosition' from 'TexSoup.utils' (/home/stefan/.local/lib/python3.8/site-packages/TexSoup/utils.py)
@Guillaume-Garrigos
Copy link
Owner

It seems that the new version of TexSoup deleted the class TokenWithPosition, without caring of retrocompatibility ...

I'm going to open an issue with them and see what can be done.

In the meantime, i'd suggest you (if possible) to uninstall TexSoup 0.3.1, and to install manually TexSoup 0.2.1. I think it should solve the issue?

@Stivanification
Copy link
Contributor Author

Yes, it solves the issue for now, thanks.

@Guillaume-Garrigos
Copy link
Owner

I raised the problem in alvinwan/TexSoup#122

@Guillaume-Garrigos Guillaume-Garrigos self-assigned this Nov 19, 2020
Guillaume-Garrigos added a commit that referenced this issue Nov 19, 2020
@Guillaume-Garrigos
Copy link
Owner

It seems that the author of TexSoup will do some more changes in his API, so I feel like changing the code on my side is not the road to go right now, otherwise I'll have to do it again in the future.

As a temporary solution, I published a new version of the moodlexport package (0.0.19) which requires exactly the version of TexSoup I need (0.2.1). This should fix any trouble for the new users.

If in the future TexSoup releases a stable version, I'll reopen this.

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