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

box_maker_generic_generator and Festi's Boxes.py extensions do not work #146

Open
Deltaplc opened this issue Mar 20, 2024 · 18 comments
Open

Comments

@Deltaplc
Copy link

Deltaplc commented Mar 20, 2024

Hi sorry to bother you...
I have installed ten extensions of this wonderful package on Inkscape 1.2 (portable app) with Win10.
All work except 2: "box.py" and "box_maker_generic_generator".
As for "box_maker_generic_generator" it's not a big problem for me because I used an older version of it that I used on inkscape 1.1 and once I ported it to 1.2 it worked fine!
As for "box.py" I would have liked to use this new version because it has some new applications but it really doesn't want to work!! I tried and tried but it doesn't work!
I attach some errors that are generated:

stderr: Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "C:\Users\Davide\Documents\Inkscape_portatile\InkscapePortable_1.2.2.paf\InkscapePortable\App\Inkscape\lib\python3.10\io.py", line 54, in
ImportError: cannot import name 'text_encoding' from 'io' (unknown location).

I also tried installing box.py on another PC... with inkscape 1.2 installed in c: and python 10 & win10..
But unfortunately it doesn't work in this case either.
I also tried with "python-interpreter" etc.... But it doesn't work!

Maybe I'm doing something wrong??
Can you give me some advice to solve the problem?

Thank you!
Greetings
Davide

@vmario89
Copy link
Contributor

Hi, i am sorry but from your posted details i cannot see what the problem should be. its a generic error in io library. also there is no file called "box.py". Do you mean the boxes.py extensions from Florian Festi?

@Deltaplc Deltaplc changed the title box.py boxs.py Apr 1, 2024
@Deltaplc
Copy link
Author

Deltaplc commented Apr 1, 2024

HI
Thank you for answering me.
Yes, sorry, I actually meant the "boxs.py by Florian Festi" extension.
When to use it this is an example of an error:


stderr: Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "C:\Users\Davide\Documents\Inkscape_portatile\InkscapePortable_1.2.2.paf\InkscapePortable\App\Inkscape\lib\python3.10\io.py", line 54, in
ImportError: cannot import name 'text_encoding' from 'io' (unknown location)


I also tried adding an interpreter:

  • python-interpreter="C:\Users\Davide\AppData\Local\Programs\Python\Python39\pythonw.exe"

But the result is the same!
Indeed, by adding the interpreter, the other applications too(box_maker_conical,box_maker_elliptical_boxbox_maker_elliptical_cone,ecc)
they give the same error!
Without the interpreter they work, except "box_maker_generic_generator", Which has the same problem as "boxs.py di Florian Festi"!!
It's not so what to do?
Do you have any solution for me?

@Deltaplc
Copy link
Author

Deltaplc commented Apr 1, 2024

HI
I tried to install your entire collection "mightyscape-1.2", on another pc... win10 inkscape 1.2 installed (not portable).
I performed all the steps also adding the python libraries
(pip install --upgrade --quiet --no-cache-dir -r %AppData%\inkscape\extensions\mightyscape-1.2\requirements.txt).

Many extensions work fine (I haven't tried them all)!
But unfortunately the extension "boxs.py by Florian Festi"
It doesn't even work on this PC...
This is the error generated:
stderr: C:\Users\Davide\AppData\Roaming\inkscape\extensions\boxes.py\boxes\scripts\boxes:21: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
from pkg_resources import get_distribution

Unfortunately the "box_maker_generic_generator" extension doesn't work either...
This is the error generated:

Traceback (most recent call last):
File "C:\Users\Davide\AppData\Roaming\inkscape\extensions\box_maker_generic_generator\box_maker_generic_generator.py", line 10, in
from more_itertools import last
File "C:\Users\Davide\AppData\Local\Programs\Python\Python310\lib\site-packages\more_itertools_init_.py", line 1, in
from more_itertools.more import * # noqa
File "C:\Users\Davide\AppData\Local\Programs\Python\Python310\lib\site-packages\more_itertools\more.py", line 3, in
from collections import Counter, defaultdict, deque, Sequence
ImportError: cannot import name 'Sequence' from 'collections' (C:\Users\Davide\AppData\Local\Programs\Python\Python310\lib\collections_init_.py)

Do you have any solution?

@vmario89 vmario89 changed the title boxs.py box_maker_generic_generator and Festi's Boxes.py extensions do not work Apr 1, 2024
@vmario89
Copy link
Contributor

vmario89 commented Apr 1, 2024

Hi. At least i removed an obsolete import from the generic box maker. it works again. See a61c354

about Boxes.py:
stderr: C:\Users\Davide\AppData\Roaming\inkscape\extensions\boxes.py\boxes\scripts\boxes:21: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html - this is only a warning, not an error.

please check your boxes output from console manually. Maybe your pip installation has some trouble. Its hard to say. You can also refer to the open issue #144 which is same topic about Boxes.py. That comment might help you: #144 (comment)

@vmario89
Copy link
Contributor

vmario89 commented Apr 1, 2024

btw. there is also 1.3.2 as portable version: https://portableapps.com/de/apps/graphics_pictures/inkscape_portable

@vmario89
Copy link
Contributor

vmario89 commented Apr 1, 2024

Hi @Deltaplc. I spent some time to this boxes.py issue. Can you check what happens when you install the requirements.txt without quiet mode? You will need to install some modules with pip like affine, qrcode and then the boxes module itself. The pip install git+https://github.com/florianfesti/boxes.git will not work maybe.

i put some documentation at florianfesti/boxes#667 as i opened some issue about installation on Windows. I do not use WIndows that often so i just might have missed some points. On my other machine boxes.py works without trouble.

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

Good morning
Excuse my English (Google translate).
And you have to excuse me if I don't immediately understand everything you tell me... I'm not an expert programmer!
I reinstalled inkscape portable 1.2! To start from scratch (clean)!
I cloned the new "mightyscape-1.2" to "%AppData%\inkscape\extensions\mightyscape-1.2"......
I've done :
pip install --upgrade --quiet --no-cache-dir -r %AppData%\inkscape\extensions\mightyscape-1.2\requirements.txt

Without using the python interpreter, "box_maker_generic_generator" Now IT WORKS!!
I've tested other extensions too and they seem to work well!

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

Unfortunately the "boxs.py by Florian Festi" extension does NOT work.
I added the python interpreter line....
"boxs.py by Florian Fest" doesn't work!
The other extensions don't even work!

id="extensions"
org.inkscape.output.png.inkscape.png_bitdepth="99"
org.inkscape.output.png.inkscape.png_compression="6"
org.inkscape.output.png.inkscape.png_antialias="2"
python-interpreter="C:\Users\Davide\AppData\Local\Programs\Python\Python39\pythonw.exe"
info.festi.boxes.py.BasedBox.inner_corners="loop"
info.festi.boxes.py.BasedBox.FingerJoint_style="rectangular"
fablabchemnitz.de.box_maker_generic_generator.unit="mm"
fablabchemnitz.de.box_maker_generic_generator.lid_type="Without"
fablabchemnitz.de.box_maker_elliptical_box.unit="mm"
fablabchemnitz.de.living_hinge.direction="y"
fablabchemnitz.de.living_hinge.unit="mm"
fablabchemnitz.de.box_maker_conical.unit="mm" />

This is the error:

Fatal Python error: init_sys_streams: can't initialize sys standard streams
Python runtime state: core initialized
Traceback (most recent call last):
File "C:\Users\Davide\Documents\Inkscape_portatile\InkscapePortable_1.2.2.paf\InkscapePortable\App\Inkscape\lib\python3.10\io.py", line 54, in
ImportError: cannot import name 'text_encoding' from 'io' (unknown location)

I don't understand, why are you talking about python 310? Shouldn't the interpreter point to python 39?

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

Before redoing the inkscape installation I also ran all the "pip"...

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

C:\Windows\system32>pip install boxes
Requirement already satisfied: boxes in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (0.9)
Requirement already satisfied: affine>=2.0 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes) (2.4.0)
Requirement already satisfied: markdown in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes) (3.6)
Requirement already satisfied: shapely>=1.8.2 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes) (2.0.3)
Requirement already satisfied: qrcode>=7.3.1 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes) (7.4.2)
Requirement already satisfied: typing-extensions in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes) (4.10.0)
Requirement already satisfied: pypng in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes) (0.20220715.0)
Requirement already satisfied: colorama in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes) (0.4.6)
Requirement already satisfied: numpy<2,>=1.14 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from shapely>=1.8.2->boxes) (1.26.4)
Requirement already satisfied: importlib-metadata>=4.4 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from markdown->boxes) (7.1.0)
Requirement already satisfied: zipp>=0.5 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from importlib-metadata>=4.4->markdown->boxes) (3.18.1)

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: c:\users\davide\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip

C:\Windows\system32>

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

C:\Windows\system32>pip install git+https://github.com/florianfesti/boxes.git
Collecting git+https://github.com/florianfesti/boxes.git
Cloning https://github.com/florianfesti/boxes.git to c:\users\davide\appdata\local\temp\pip-req-build-1qgjklmw
Running command git clone --filter=blob:none --quiet https://github.com/florianfesti/boxes.git 'C:\Users\Davide\AppData\Local\Temp\pip-req-build-1qgjklmw'
Resolved https://github.com/florianfesti/boxes.git to commit b4517a9f22ea1bf8ae01c5d29dd19a0b0c843d5d
Preparing metadata (setup.py) ... done
Requirement already satisfied: affine>=2.0 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (2.4.0)
Requirement already satisfied: markdown in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (3.6)
Requirement already satisfied: shapely>=1.8.2 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (2.0.3)
Requirement already satisfied: qrcode>=7.3.1 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (7.4.2)
Requirement already satisfied: typing-extensions in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (4.10.0)
Requirement already satisfied: pypng in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (0.20220715.0)
Requirement already satisfied: colorama in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (0.4.6)
Requirement already satisfied: numpy<2,>=1.14 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from shapely>=1.8.2->boxes==0.9) (1.26.4)
Requirement already satisfied: importlib-metadata>=4.4 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from markdown->boxes==0.9) (7.1.0)
Requirement already satisfied: zipp>=0.5 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from importlib-metadata>=4.4->markdown->boxes==0.9) (3.18.1)

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: c:\users\davide\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip

C:\Windows\system32>
C:\Users\Davide\AppData\Local\Programs\Python\Python39>pip install git+https://github.com/florianfesti/boxes.git
Collecting git+https://github.com/florianfesti/boxes.git
Cloning https://github.com/florianfesti/boxes.git to c:\users\davide\appdata\local\temp\pip-req-build-jjnpgf_q
Running command git clone --filter=blob:none --quiet https://github.com/florianfesti/boxes.git 'C:\Users\Davide\AppData\Local\Temp\pip-req-build-jjnpgf_q'
Resolved https://github.com/florianfesti/boxes.git to commit b4517a9f22ea1bf8ae01c5d29dd19a0b0c843d5d
Preparing metadata (setup.py) ... done
Requirement already satisfied: affine>=2.0 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (2.4.0)
Requirement already satisfied: markdown in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (3.6)
Requirement already satisfied: shapely>=1.8.2 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (2.0.3)
Requirement already satisfied: qrcode>=7.3.1 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from boxes==0.9) (7.4.2)
Requirement already satisfied: typing-extensions in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (4.10.0)
Requirement already satisfied: pypng in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (0.20220715.0)
Requirement already satisfied: colorama in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from qrcode>=7.3.1->boxes==0.9) (0.4.6)
Requirement already satisfied: numpy<2,>=1.14 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from shapely>=1.8.2->boxes==0.9) (1.26.4)
Requirement already satisfied: importlib-metadata>=4.4 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from markdown->boxes==0.9) (7.1.0)
Requirement already satisfied: zipp>=0.5 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from importlib-metadata>=4.4->markdown->boxes==0.9) (3.18.1)

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Windows\system32>cd %AppData%..\Local\Programs\Python\Python39\Scripts

C:\Users\Davide\AppData\Local\Programs\Python\Python39\Scripts>python -m pip install --upgrade pip #upgrade pip first
C:\Program Files\Inkscape\bin\python.exe: No module named pip

C:\Users\Davide\AppData\Local\Programs\Python\Python39\Scripts>pip install --upgrade --quiet --no-cache-dir -r %AppData%\inkscape\extensions\mightyscape-1.2\requirements.txt
WARNING: shapely 2.0.3 does not provide the extra 'vectorized'

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: c:\users\davide\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip

C:\Users\Davide\AppData\Local\Programs\Python\Python39\Scripts>

C:\Users\Davide\AppData\Local\Programs\Python\Python39\Scripts>pip install shapely
Requirement already satisfied: shapely in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (2.0.3)
Requirement already satisfied: numpy<2,>=1.14 in c:\users\davide\appdata\local\programs\python\python39\lib\site-packages (from shapely) (1.26.4)

[notice] A new release of pip is available: 23.2.1 -> 24.0
[notice] To update, run: c:\users\davide\appdata\local\programs\python\python39\python.exe -m pip install --upgrade pip

C:\Users\Davide\AppData\Local\Programs\Python\Python39\Scripts>

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

On the PC I'm using at the moment I'm using a version of inkscape 1.1 (installed in c:) where I had cloned part of an old version of "mightyscape"...
where everything works well! The extension "boxs.py by Florian Festi" still uses "boxes.exe".
I tried to clone the new package "mightyscape 1.2" and magically everything works!!
I've done some tests, everything works with or without the python interpreter line!!
So the problem lies in the portable version 1.2 !?
Can the fact that I also have an installed version create problems for the portable version?

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

I tried one more time!!!
I reinstalled Inkscape 1.2 (c: not portable) on another PC (Win10, Python 310).
The PC is still the one where I did the tests and the extensions didn't work!
I redid the entire procedure I did on the portable version of the other PC....
Cloned the new version of "mightyscape-1.2" into:

%AppData%\inkscape\extensions

And now EVERYTHING WORKS!!!!!
Even without the interpreter python line!!!

At this point I think I can say that it is not a problem with the version of inkscape 1.1 or 1.2....
There remains a problem on the portable version of inkscape!

@Deltaplc
Copy link
Author

Deltaplc commented Apr 2, 2024

PS:
Thanks for the link to inkscape 1.3 portable, it doesn't appear on the official site!
But I prefer to use version 1.1!
The subsequent versions have graphics that I don't like!
Obviously it's a personal opinion!

@Deltaplc
Copy link
Author

Deltaplc commented Apr 3, 2024

Good morning
I have a hard head....
This morning I did another test!!
Win10 PC
Cleaned, uninstalled inkscape, python, etc.
I wanted to try starting from scratch!
Procedure:
-installed python 10.0
-installed inkscape1.2 portable
-installed GIT
Cloned -mightyscape-1.2
inside: C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\Data\settings\extensions\mightyscape-1.2\requirements.txt
Restarted the PC!
Done:
pip install --upgrade --quiet --no-cache-dir -r C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\Data\settings\extensions\mightyscape-1.2\requirements.txt
Wait a few minutes....it takes a while....
Some errors came out! I thought it didn't go through!!
Restarted the PC!
Miracle!!!
The extensions work!!
"boxs.py by Florian Festi" ....
and also "box_maker_generic_generator".
I've tested some extensions, (some box creators, etc.) for the moment everything seems to work!!

@Deltaplc
Copy link
Author

Deltaplc commented Apr 3, 2024

Everything works even without adding the python interpreter line!
If I add the python interpreter line nothing works anymore!!
The extensions generate this error:
Traceback (most recent call last):
File "C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\Data\settings\extensions\mightyscape-1.2\extensions\fablabchemnitz\box_maker_generic_generator\box_maker_generic_generator.py", line 11, in
import inkex
File "C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\App\Inkscape\share\inkscape\extensions\inkex_init_.py", line 11, in
from .extensions import *
File "C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\App\Inkscape\share\inkscape\extensions\inkex\extensions.py", line 34, in
from .elements import (
File "C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\App\Inkscape\share\inkscape\extensions\inkex\elements_init_.py", line 9, in
from ._parser import SVG_PARSER, load_svg
File "C:\Users\Davide\Desktop\Inkscape_Portatile_1.2\InkscapePortable\App\Inkscape\share\inkscape\extensions\inkex\elements_parser.py", line 30, in
from lxml import etree
ModuleNotFoundError: No module named 'lxml'

@Deltaplc
Copy link
Author

Deltaplc commented Apr 3, 2024

This is my python interpreter line!
Did I make some mistakes???

group
id="extensions"
org.inkscape.output.png.inkscape.png_bitdepth="99"
org.inkscape.output.png.inkscape.png_compression="6"
org.inkscape.output.png.inkscape.png_antialias="2"
python-interpreter="C:\Users\Davide\AppData\Local\Programs\Python\Python310\pythonw.exe"
fablabchemnitz.de.box_maker_conical.unit="mm"
fablabchemnitz.de.box_maker_generic_generator.unit="mm"
fablabchemnitz.de.box_maker_generic_generator.lid_type="Without"
info.festi.boxes.py.BasedBox.inner_corners="loop"
info.festi.boxes.py.BasedBox.FingerJoint_style="rectangular"
fablabchemnitz.de.living_hinge.direction="x"
fablabchemnitz.de.living_hinge.unit="mm"
info.festi.boxes.py.DiceBox.inner_corners="loop"
info.festi.boxes.py.DiceBox.FingerJoint_style="rectangular"
fablabchemnitz.de.living_hinge.live_effect="0"
info.festi.boxes.py.UniversalBox.top_edge="e"
info.festi.boxes.py.UniversalBox.bottom_edge="F"
info.festi.boxes.py.UniversalBox.vertical_edges="finger joints"
info.festi.boxes.py.UniversalBox.inner_corners="loop"
info.festi.boxes.py.UniversalBox.FingerJoint_style="rectangular"
info.festi.boxes.py.UniversalBox.Hinge_style="outset"
info.festi.boxes.py.UniversalBox.CabinetHinge_style="inside"
info.festi.boxes.py.UniversalBox.SlideOnLid_spring="both"
info.festi.boxes.py.UniversalBox.SlideOnLid_style="rectangular"
info.festi.boxes.py.UniversalBox.Mounting_side="back"
info.festi.boxes.py.UniversalBox.Mounting_style="straight edge, within"
info.festi.boxes.py.UniversalBox.Lid_handle="none"
info.festi.boxes.py.UniversalBox.Lid_style="none"
info.festi.boxes.py.Console.inner_corners="loop"
info.festi.boxes.py.Console.FingerJoint_style="rectangular"
fablabchemnitz.de.gears.units="mm"
fablabchemnitz.de.gears.system="MM"
fablabchemnitz.de.gears.accuracy="0" />
<group

@Deltaplc
Copy link
Author

Deltaplc commented Apr 3, 2024

I tried to install (on the same PC) inkscape 1.2 and also 1.3 directly in C: for all users!
Cloned -mightyscape-1.2.
Into C:\Users\Davide\AppData\Roaming\inkscape\extensions.
Everything works in this case too!
Without python interpreter line!

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