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

maybe still a bug here - inkscape1.0 - simplestyle #36

Closed
nicolasdb opened this issue Jun 24, 2020 · 3 comments
Closed

maybe still a bug here - inkscape1.0 - simplestyle #36

nicolasdb opened this issue Jun 24, 2020 · 3 comments

Comments

@nicolasdb
Copy link

nicolasdb commented Jun 24, 2020

I'm on linux Manjaro, inkscape1.0 of course.
Python3 is installed.
And boxmaker.py is executable

Settings by default
image

And I receive this message:

Traceback (most recent call last):
  File "boxmaker.py", line 53, in <module>
    import os,sys,inkex,simplestyle,gettext,math
ImportError: bad magic number in 'simplestyle': b'\x03\xf3\r\n'

How can I help?

@paulh-rnd
Copy link
Owner

Thanks for the report.

It seems this is related to .pyc file corruption, or version issues when upgrading to Python 3 and not the TabbedBoxMaker extension itself. I've tested this on CentOS 8.2 and it seems to work fine, I haven't tested with Manjaro, but I think you might have luck removing some of the .pyc files as suggested in the following GitHub and SO answers (and there are many others):

Miserlou/Zappa#854
songdejia/EAST#17
https://stackoverflow.com/questions/52477683/importerror-bad-magic-number-in-time-b-x03-xf3-r-n-in-django
https://stackoverflow.com/questions/52698854/importerror-bad-magic-number-in-dateparser-b-x03-xf3-r-n

I'd suggest locating your __pycache__ directory and clearing those cache files out (see the answer in the last link above, run this command in the pycache dir). Let me know if that doesn't fix it, and if you can provide any further insights that might help me repro, I'll reopen this issue.

On a side note and maybe related: simplestyle may be deprecated and the extension upgrade guide says to remove dependency listings for simplestyle.py from .inx files, but it doesn't mention anything relating to script files. I'm using it currently and not sure what the alternative might be, so for now it stays :)

@nicolasdb
Copy link
Author

Thanks,
I'll share what I found here, just in case.

After reading more about it, it is indeed a problem of cache when upgrading from python 2>3.
So I enter this command on root directory and the problem is solved. 🎆
sudo find . -name "*.pyc" -exec rm -f {} \;

note: the command didn't worked on home directory.


I tried on another computer with a recent install of Manjaro20.0.
I got this error but It's just about LXML not being installed by default. Easy to fix.

image
image

@paulh-rnd
Copy link
Owner

awesome, thanks for the info @nicolasdb! Good to hear you solved it.

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