Topic: qet_tb_generator installation

Hi,

I updated my Qet software a few days ago, and watching the "terminal generation" tutorial, I tried to run the script in the title. Installed python 3.6, installed the script in the python folder, but Qet doesn't recognize or find it for some reason. I get the same installation instructions window when I go to Project->Launch terminal block generation plugin.

Any advice?

Re: qet_tb_generator installation

Additional info: my Python script folder c:\Users\smihu\AppData\Local\Programs\Python\Python36\Scripts\

Re: qet_tb_generator installation

>> First install on Windows
1. Install, if required, python 3.5 or above
2. pip install qet_generator
>> Update on Windows
python -m pip install --upgrade qet_tb_generator

https://download.tuxfamily.org/qet/foru … in_pip.png

4 (edited by gabe 2017-06-07 14:15:34)

Re: qet_tb_generator installation

Here's a file with the error I get when trying to install the script (see attached file):

Post's attachments

qet_python.JPG, 93.88 kb, 660 x 592
qet_python.JPG 93.88 kb, 367 downloads since 2017-06-07 

Re: qet_tb_generator installation

Solution: run cmd as administrator.

Windows->Start->type "cmd", right click and "Run as administrator"->execute qet install command.

Re: qet_tb_generator installation

Hello i have got a problem in fact, i want to launch qet_tb_generator in Qelectro, it's not install...
But i launch windows in your example and compilation run

C:\Users\admin\AppData\Local\Programs\Python\Python36\Scripts>pip install qet_tb_generator
Collecting qet_tb_generator
  Downloading qet_tb_generator-0.7.72-py3-none-any.whl
Collecting pyqt5 (from qet_tb_generator)
  Downloading PyQt5-5.9.2-5.9.3-cp35.cp36.cp37-none-win_amd64.whl (77.4MB)
    100% |████████████████████████████████| 77.4MB 14kB/s
Collecting sip<4.20,>=4.19.4 (from pyqt5->qet_tb_generator)
  Downloading sip-4.19.6-cp36-none-win_amd64.whl (51kB)
    100% |████████████████████████████████| 51kB 2.8MB/s
Installing collected packages: sip, pyqt5, qet-tb-generator
Successfully installed pyqt5-5.9.2 qet-tb-generator-0.7.72 sip-4.19.6

Re: qet_tb_generator installation

Bonjour,
Tout d'abord merci pour le travail réalisé.

Je n'arrive pas à lancer le générateur.
Quand j'ouvre l'option dans QET j'ai la fenêtre qui me demande d'installer le plugin.
Et j'ai eu ce message lors de l'installation puis lors de la mise à jour.

C:\Users\----\AppData\Local\Programs\Python\Python38>python -m pip install --upgrade qet_tb_generator
Collecting qet_tb_generator
  Downloading qet_tb_generator-1.1.6-py3-none-any.whl (29 kB)
Installing collected packages: qet-tb-generator
  Attempting uninstall: qet-tb-generator
    Found existing installation: qet-tb-generator 1.1.5
    Uninstalling qet-tb-generator-1.1.5:
      Successfully uninstalled qet-tb-generator-1.1.5
  WARNING: The script qet_tb_generator.exe is installed in 'C:\Users\Gequo\AppData\Local\Programs\Python\Python38\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed qet-tb-generator-1.1.6

J'imagine que j'ai un problème de localisation des fichiers mais je ne comprend pas où ça coince...

Re: qet_tb_generator installation

Bonsoir et merci pour les compliments,

le plugin se lance quand même après?, on a souvent des faux positif le message d’alarme apparaît demandant d'installer le plugin avec sa procédure mais entre temps le générateur de bornier apparaît.
Faudrait temporiser le warning ou s’assurer que le QFile existe avant de le lancer le QProces.
process->startDetached(QDir::homePath() + "/Application Data/qet/qet_tb_generator.exe", {(QETDiagramEditor::currentProjectView()->project()->filePath())});

https://git.tuxfamily.org/qet/qet.git/t … .cpp#n2260

9 (edited by nicogrim 2020-08-29 21:20:10)

Re: qet_tb_generator installation

Le plugin ne se lance pas après, par contre si je le lance directement dans le terminal j'ai une également une erreur :

C:\Users\----\AppData\Local\Programs\Python\Python38\Scripts>qet_tb_generator
20:05:56 INFO     ** QElectrotech terminal block plug-in - v1.1.6 ** [main.main:839]
Traceback (most recent call last):
  File "c:\users\----\appdata\local\programs\python\python38\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\----\appdata\local\programs\python\python38\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\----\AppData\Local\Programs\Python\Python38\Scripts\qet_tb_generator.exe\__main__.py", line 7, in <module>
  File "c:\users\----\appdata\local\programs\python\python38\lib\site-packages\src\main.py", line 850, in main
    qet_project = QETProject(qet_file)  # allows working with a QET XML file.
  File "c:\users\----\appdata\local\programs\python\python38\lib\site-packages\src\qetproject.py", line 67, in __init__
    self._qet_tree = etree.parse(project_file)
  File "c:\users\----\appdata\local\programs\python\python38\lib\xml\etree\ElementTree.py", line 1202, in parse
    tree.parse(source, parser)
  File "c:\users\----\appdata\local\programs\python\python38\lib\xml\etree\ElementTree.py", line 595, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: unbound prefix: line 8, column 20

Je pense que je n'ai peut être pas respecté les chemins d'installation

Re: qet_tb_generator installation

J'ai suivi la procédure du message
https://qelectrotech.org/forum/viewtopi … 07&p=5
maintenant le plugin semble se lancer directement dans QElectroTech mais rien ne se passe.
Si je lance le plugin dans le CMD j'ai de nouveau un message d"erreur :

C:\Users\---->qet_tb_generator
21:36:26 INFO     ** QElectrotech terminal block plug-in - v1.1.6 ** [main.main:839]
Traceback (most recent call last):
  File "c:\users\----\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\----\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\----\AppData\Local\Programs\Python\Python37\Scripts\qet_tb_generator.exe\__main__.py", line 7, in <module>
  File "c:\users\----\appdata\local\programs\python\python37\lib\site-packages\src\main.py", line 850, in main
    qet_project = QETProject(qet_file)  # allows working with a QET XML file.
  File "c:\users\----\appdata\local\programs\python\python37\lib\site-packages\src\qetproject.py", line 67, in __init__
    self._qet_tree = etree.parse(project_file)
  File "c:\users\----\appdata\local\programs\python\python37\lib\xml\etree\ElementTree.py", line 1197, in parse
    tree.parse(source, parser)
  File "c:\users\----\appdata\local\programs\python\python37\lib\xml\etree\ElementTree.py", line 598, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: unbound prefix: line 8, column 20

Re: qet_tb_generator installation

Tu peux envoyer ton projet et ainsi que le message d'erreur à Raul l'auteur du plugin?
https://pypi.org/project/qet-tb-generator/

Lui seul seul doit pouvoir t'aider.
désolé si je ne peux pas t'aider plus, mais j'ai mille choses à faire et je ne sais plus ou donner de la tète en ce moment ..
et la reprise du boulot arrive a grand pas ..

Re: qet_tb_generator installation

scorpio810 wrote:

Tu peux envoyer ton projet et ainsi que le message d'erreur à Raul l'auteur du plugin?
https://pypi.org/project/qet-tb-generator/

Lui seul seul doit pouvoir t'aider.
désolé si je ne peux pas t'aider plus, mais j'ai mille choses à faire et je ne sais plus ou donner de la tète en ce moment ..
et la reprise du boulot arrive a grand pas ..

Je vais faire ça merci

Re: qet_tb_generator installation

Je pense qu'il sera plus réactif par email, il est tres pris et il me semble qu'il n'a pas trop le temps de venir lire ici les retours et problemes de son plugin.

Nous le remercions encore pour son travail.

Re: qet_tb_generator installation

C'est en anglais avec lui c'est ça?

Re: qet_tb_generator installation

Je pense qu'en anglais il comprendra à moins que tu écrives bien l'espagnol?

16 (edited by unalcalde 2020-08-30 09:20:33)

Re: qet_tb_generator installation

Hi Nicogrim, I've checked your QET schema and the problem is the logo at the title block.

The QET schema files are a XML type file, and the library I use in the Terminal Block plug-in requires that the XML file is well-formed.
If you get a error likes this : "xml.etree.ElementTree.ParseError: unbound prefix: line 8, column 20", open the qet schema file in a text editor and you will see this (line 8)

    <ns0:svg ns1:version="0.46+devel" id="Livello_1" ns1:output_extension="org.inkscape.output.svgz.inkscape" viewBox="0 0 116 116" width="128" ns1:export-filename="/home/pinheiro/pics/oxygen-icons/scalable/apps/QElectroTech.png" overflow="visible" ns1:export-ydpi="67.5" xml:space="preserve" ns2:version="0.32" height="128" ns2:docname=" QElectroTech.svgz" enable-background="new 0 0 116 116" ns1:export-xdpi="67.5" version="1.0">

The "ns0" of the "ns0:svg" is a XML namespace ( https://www.w3schools.com/XML/xml_namespaces.asp ), and must be defined berefe the first use.
The easy wey to solve this is adding de namesapce definition in the first line:

Original first line:

<project folioSheetQuantity="1" title="CTA SBO 39CZ450" version="0.70">

Modified first line with the namespace definition:

<project folioSheetQuantity="1" title="CTA SBO 39CZ450" version="0.70" xmlns:ns0="ns0">

Specifically in your XML file there are 7 different namespaces used but not defined. So the solution is change the first line like this:

<project folioSheetQuantity="1" title="CTA SBO 39CZ450" version="0.70" xmlns:ns0="ns0" xmlns:ns1="ns1"  xmlns:ns2="ns2" xmlns:rdf="rdf" xmlns:ns4="ns4" xmlns:dc="dc"  xmlns:ns6="ns6">

The easy way to find all namespaces is fix one editing the first line, save it, and try again the plugin from the console. A new unbound error will say you where are a next namespace.

PD: I've checked the possibility that the ElementTree library I use in the plugin omits the namespaces, but didn't find the possibility.

Re: qet_tb_generator installation

Thanks a lot.

I replace the first line and now it's working well.

About the namespaces i'm not sure how i generate differents names.

I think i have to learn a good way to create a project step by step.

Maybe i will looking for someone around my location to help me...