Annexes:Python : Différence entre versions
(→Installation) |
|||
Ligne 85 : | Ligne 85 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | ===Mise à jour de l'environnement=== | ||
Dans le ~dbsqware/.bash_profile | Dans le ~dbsqware/.bash_profile | ||
<syntaxhighlight lang="sh" line> | <syntaxhighlight lang="sh" line> | ||
Ligne 113 : | Ligne 114 : | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | ===Installation des dépendances=== |
Version du 10 février 2025 à 10:39
Sommaire
Généralités
Limites de cette section
Cette section n’a pas la prétention de traiter tous les cas possibles d'installation de Python …
Le principe est d'avoir la bonne version et ses dépendances pour le module SQWarePredict.
Avant de vous lancer dans l’installation, vous devez d'abord avoir la version de dbSQWare avec SQWarePredict (v2025.01 mini) pour avoir les dépendances.
Principe
Nous allons :
- Installer Python-3.12.8
- Configurer l'environnement
- Installer les dépendances
Installation
Installation de Python-3.12.8
Téléchargez les sources et mettez-les dans /tmp :
# Install Python-3.12.8 # https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tgz
1 # From : dbsqware@vmsqwarebox
2
3 mkdir /home/dbsqware/dbSQWare/SQWarePredict/python-src
4 mkdir -p /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8
5 cd /home/dbsqware/dbSQWare/SQWarePredict/python-src
6 tar -xzvf /tmp/Python-3.12.8.tgz
7 cd Python-3.12.8
8
9 # configure, dest => /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8
10 ./configure --prefix=/home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8 --enable-optimizations
checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu checking for python3.9... python3.9 checking for --enable-universalsdk... no checking for --with-universal-archs... no ...
1 # compil
2 make
Running code to generate profile data (this can take a while): # First, we need to create a clean build with profile generation # enabled. make profile-gen-stamp make[1]: Entering directory '/home/dbsqware/dbSQWare/SQWarePredict/python-src/Python-3.12.8' make clean make[2]: Entering directory '/home/dbsqware/dbSQWare/SQWarePredict/python-src/Python-3.12.8' find . -depth -name '__pycache__' -exec rm -rf {} ';' ...
1 # install
2 make install
Creating directory /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin Creating directory /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/lib if test "no-framework" = "no-framework" ; then \ /usr/bin/install -c python /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin/python3.9; \ ... ... Installing collected packages: setuptools, pip WARNING: The scripts pip3 and pip3.9 are installed in '/home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/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 pip-23.0.1 setuptools-58.1.0
1 # creation des liens python et pip
2 cd /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin
3 ln -s python3 python
4 ln -s pip3 pip
Mise à jour de l'environnement
Dans le ~dbsqware/.bash_profile
1 # env Python 3.12.8 (pour SQWarePredict)
2 export PATH=/home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin:$PATH
3 export LD_LIBRARY_PATH=/home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/lib:$LD_LIBRARY_PATH
1 # vérification du PATH
2
3 dbsqware@vmsqwarebox:/home/dbsqware $ type python
4 python is /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin/python
5
6 dbsqware@vmsqwarebox:/home/dbsqware $ type pip
7 pip is /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/bin/pip
1 # vérification des versions
2
3 dbsqware@vmsqwarebox:/home/dbsqware $ python --version
4 Python 3.12.8
5
6 dbsqware@vmsqwarebox:/home/dbsqware $ pip --version
7 pip 23.0.1 from /home/dbsqware/dbSQWare/SQWarePredict/python/3.12.8/lib/python3.9/site-packages/pip (python 3.9)