#1 Le 21/05/2020, à 21:31
- Jaenne
[RESOLU] Pyinstaller ajouter au PATH ?
Salut,
Je viens d’installer pyinstaller via pip3 sur mon Ubuntu 20,04.
L’installation s’est bien passée mais je pense que je vais avoir des problèmes si je l’utilise en l’état :
pip3 install pyinstaller
Collecting pyinstaller
Downloading PyInstaller-3.6.tar.gz (3.5 MB)
|████████████████████████████████| 3.5 MB 729 kB/s
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from pyinstaller) (45.2.0)
Collecting altgraph
Downloading altgraph-0.17-py2.py3-none-any.whl (21 kB)
Building wheels for collected packages: pyinstaller
Building wheel for pyinstaller (PEP 517) ... done
Created wheel for pyinstaller: filename=PyInstaller-3.6-py3-none-any.whl size=2926545 sha256=2231c0548cb13fc511d4826fdf4f1b0c29ff99408ccf1a5b003e6eea060b913a
Stored in directory: /home/jaenne/.cache/pip/wheels/57/9a/e0/213da356866201eac897534a77c7af30b48b48c2734e30a25f
Successfully built pyinstaller
Installing collected packages: altgraph, pyinstaller
WARNING: The scripts pyi-archive_viewer, pyi-bindepend, pyi-grab_version, pyi-makespec, pyi-set_version and pyinstaller are installed in '/home/jaenne/.local/bin' 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 altgraph-0.17 pyinstaller-3.6
Dois-je réinstaller dans un autre dossier ?
Si non, ça consiste en quoi d’ajouter un dossier dans le PATH ? Est-ce faisable en ligne de commande ? Dois-je modifier un des fichiers de Pyinstaller ?
Merci d’avance si vous pouvez m’éclairer.
D'après ce que je comprends de ce site (pas grand chose) :
comment ajouter un répertoire....
Meilleur extrait :
La preuve dans le pudding est exécutée
je dois faire :
export PATH = /home/jaenne/.local/bin
Mais la confiance est pas au top !
Selon cette source :
stack overflow
je dois faire :
sudo find / -name pyinstaller
et modifier mon bashrc comme suit :
export PATH="/path/to/pyinstaller:$PATH"
soit :
export PATH="/home/jaenne/.local/bin:$PATH"
soit :
export PATH="/home/jaenne/.local/bin/pyinstaller:$PATH"
Ca à l'air bien ça !
sudo find / -name bashrc
[sudo] Mot de passe de jaenne :
find: ‘/run/user/1000/doc’: Permission non accordée
find: ‘/run/user/1000/gvfs’: Permission non accordée
Il se situe dans le dossier /home/$USER/.bashrc.
pwd
/home/jaenne
jaenne@**********:~$ ls
Bureau HTML5_CSS3 Modèles Public snap Vidéos
Documents Images Musique Python Téléchargements
sudo find / -name pyinstaller
/home/jaenne/.local/bin/pyinstaller
find: ‘/run/user/1000/doc’: Permission non accordée
find: ‘/run/user/1000/gvfs’: Permission non accordée
J'ai le bashrc, c'est un fichier caché. J'en ai fais une copie au cas ou...
I found the location of pyinstaller but where do I add the path in the .bashrc file? – Mike Sep 22 '16 at 19:05
If there isn't already a line that starts with "export PATH=", just add it at the end of the file. – CosmicChuck Sep 22 '16 at 19:19
J'ajoute une ligne à la fin du fichier bashrc :
export PATH="/home/jaenne/.local/bin/pyinstaller:$PATH"
Après modification du fichier .bashrc, il faut relancer bash ou recharger le fichier :
source ~/.bashrc
Test :
jaenne@**********:~$ cd /home/jaenne/Python/portail
jaenne@*******:~/Python/portail$ pyinstaller --onefile clef.py
pyinstaller : commande introuvable
Je modifie la ligne à la fin du fichier bashrc :
export PATH="/home/jaenne/.local/bin:$PATH"
source ~/.bashrc
Test :
jaenne@**********:~/Python/portail$ pyinstaller --onefile clef.py
36 INFO: PyInstaller: 3.6
36 INFO: Python: 3.8.2
85 INFO: Platform: Linux-5.4.0-31-generic-x86_64-with-glibc2.29
86 INFO: wrote /home/jaenne/Python/portail/clef.spec
87 INFO: UPX is not available.
88 INFO: Extending PYTHONPATH with paths
['/home/jaenne/Python/portail', '/home/jaenne/Python/portail']
88 INFO: checking Analysis
88 INFO: Building Analysis because Analysis-00.toc is non existent
88 INFO: Initializing module dependency graph...
89 INFO: Caching module graph hooks...
93 INFO: Analyzing base_library.zip ...
3214 INFO: Processing pre-find module path hook distutils
3214 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.8'
6283 INFO: Caching module dependency graph...
6398 INFO: running Analysis Analysis-00.toc
6467 INFO: Analyzing /home/jaenne/Python/portail/clef.py
6487 INFO: Processing module hooks...
6487 INFO: Loading module hook "hook-xml.etree.cElementTree.py"...
6488 INFO: Loading module hook "hook-xml.py"...
6548 INFO: Loading module hook "hook-lib2to3.py"...
6549 INFO: Loading module hook "hook-pydoc.py"...
6550 INFO: Loading module hook "hook-sysconfig.py"...
6576 INFO: Loading module hook "hook-encodings.py"...
6634 INFO: Loading module hook "hook-distutils.py"...
6645 INFO: Looking for ctypes DLLs
6682 INFO: Analyzing run-time hooks ...
6686 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
6695 INFO: Looking for dynamic libraries
7205 INFO: Looking for eggs
7205 INFO: Python library not in binary dependencies. Doing additional searching...
7358 INFO: Using Python library /lib/x86_64-linux-gnu/libpython3.8.so.1.0
7362 INFO: Warnings written to /home/jaenne/Python/portail/build/clef/warn-clef.txt
7395 INFO: Graph cross-reference written to /home/jaenne/Python/portail/build/clef/xref-clef.html
7407 INFO: checking PYZ
7407 INFO: Building PYZ because PYZ-00.toc is non existent
7407 INFO: Building PYZ (ZlibArchive) /home/jaenne/Python/portail/build/clef/PYZ-00.pyz
7877 INFO: Building PYZ (ZlibArchive) /home/jaenne/Python/portail/build/clef/PYZ-00.pyz completed successfully.
7882 INFO: checking PKG
7882 INFO: Building PKG because PKG-00.toc is non existent
7883 INFO: Building PKG (CArchive) PKG-00.pkg
10321 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
10323 INFO: Bootloader /home/jaenne/.local/lib/python3.8/site-packages/PyInstaller/bootloader/Linux-64bit/run
10323 INFO: checking EXE
10323 INFO: Building EXE because EXE-00.toc is non existent
10323 INFO: Building EXE from EXE-00.toc
10323 INFO: Appending archive to ELF section in EXE /home/jaenne/Python/portail/dist/clef
10412 INFO: Building EXE from EXE-00.toc completed successfully.
Yeah !
Dernière modification par Jaenne (Le 22/05/2020, à 00:15)
Hors ligne