Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 01/05/2017, à 12:06

serviteur

[RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Salut a tous,

J'ai Python de la version 2.7.12 et 3.5.2 qui sont installés sur 16.04

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ python3 -V
Python 3.5.2
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ python2.7 -V
Python 2.7.12
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

J'ai installé un addon pour Blender 2.78x qui nécessite d'installer Python 3.5.

Setup shapely under ubuntu

Under ubuntu (tested under 16.10) Blender 2.77-2.78 should use the python 3.5 built on the system.

ensure you have pip for python 3.x
sudo apt-get install python3-pip

setup shapely
sudo /usr/lib/python3.5/python3.5 -m pip install shapely

To test the installation open Blender Python console and type

from shapely import geometry

Should you not find python under this path on your system, then open Blender's python console and type:

import sys
sys.path

Blender should report many path it does use. Find the one ending with /python3.5
Contact GitHub API Training Shop Blog About


Installation de

sudo apt-get install python3-pip
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo apt-get install python3-pip
[sudo] Mot de passe de serviteur : 
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
The following additional packages will be installed:
  libpython3-dev python3-dev python3-setuptools python3-wheel
Paquets suggérés :
  python-setuptools-doc
Les NOUVEAUX paquets suivants seront installés :
  libpython3-dev python3-dev python3-pip python3-setuptools python3-wheel
0 mis à jour, 5 nouvellement installés, 0 à enlever et 3 non mis à jour.
Il est nécessaire de prendre 253 ko dans les archives.
Après cette opération, 1 281 ko d'espace disque supplémentaires seront utilisés.
Souhaitez-vous continuer ? [O/n] o
Réception de:1 http://cm.archive.ubuntu.com/ubuntu xenial/main amd64 libpython3-dev amd64 3.5.1-3 [6 926 B]
Réception de:2 http://cm.archive.ubuntu.com/ubuntu xenial/main amd64 python3-dev amd64 3.5.1-3 [1 186 B]
Réception de:3 http://cm.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 python3-pip all 8.1.1-2ubuntu0.4 [109 kB]
Réception de:4 http://cm.archive.ubuntu.com/ubuntu xenial/main amd64 python3-setuptools all 20.7.0-1 [88,0 kB]
Réception de:5 http://cm.archive.ubuntu.com/ubuntu xenial/universe amd64 python3-wheel all 0.29.0-1 [48,1 kB]
253 ko réceptionnés en 17s (14,9 ko/s)                                         
Sélection du paquet libpython3-dev:amd64 précédemment désélectionné.
(Lecture de la base de données... 306927 fichiers et répertoires déjà installés.)
Préparation du dépaquetage de .../libpython3-dev_3.5.1-3_amd64.deb ...
Dépaquetage de libpython3-dev:amd64 (3.5.1-3) ...
Sélection du paquet python3-dev précédemment désélectionné.
Préparation du dépaquetage de .../python3-dev_3.5.1-3_amd64.deb ...
Dépaquetage de python3-dev (3.5.1-3) ...
Sélection du paquet python3-pip précédemment désélectionné.
Préparation du dépaquetage de .../python3-pip_8.1.1-2ubuntu0.4_all.deb ...
Dépaquetage de python3-pip (8.1.1-2ubuntu0.4) ...
Sélection du paquet python3-setuptools précédemment désélectionné.
Préparation du dépaquetage de .../python3-setuptools_20.7.0-1_all.deb ...
Dépaquetage de python3-setuptools (20.7.0-1) ...
Sélection du paquet python3-wheel précédemment désélectionné.
Préparation du dépaquetage de .../python3-wheel_0.29.0-1_all.deb ...
Dépaquetage de python3-wheel (0.29.0-1) ...
Traitement des actions différées (« triggers ») pour man-db (2.7.5-1) ...
Paramétrage de libpython3-dev:amd64 (3.5.1-3) ...
Paramétrage de python3-dev (3.5.1-3) ...
Paramétrage de python3-pip (8.1.1-2ubuntu0.4) ...
Paramétrage de python3-setuptools (20.7.0-1) ...
Paramétrage de python3-wheel (0.29.0-1) ...
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶

Pour:

sudo /usr/lib/python3.5/python3.5 -m pip install shapely
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /usr/lib/python3.5/python3.5 -m pip install shapely
[sudo] Mot de passe de serviteur : 
sudo: /usr/lib/python3.5/python3.5 : commande introuvable
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ /usr/lib/python3.5/python3.5 -m pip install shapely
bash: /usr/lib/python3.5/python3.5: Aucun fichier ou dossier de ce type
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

Pour installer Shapely, j'ai suivi la procedure de ce lien: https://github.com/s-leger/blenderPolygons/wiki/Setup

serviteur @ HP-EliteBook-8760w  ~└─ $ ▶ pip install shapely
Collecting shapely
  Downloading Shapely-1.5.17.post1-cp27-cp27mu-manylinux1_x86_64.whl (8.3MB)
    100% |████████████████████████████████| 8.3MB 81kB/s 
Installing collected packages: shapely
Successfully installed shapely
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶
serviteur @ HP-EliteBook-8760w  ~└─ $ ▶ GEOS_CONFIG=/path/to/geos-config pip install shapely
Collecting shapely
  Using cached Shapely-1.5.17.post1-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: shapely
Successfully installed shapely-1.5.17.post1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶

Pourquoi est ce que la commande (sudo: /usr/lib/python3.5/python3.5 ) n'est pas introuvable sur Xubuntu et ya t-il une solution ?


Discussion sur blenderartist.

Dernière modification par serviteur (Le 07/05/2017, à 21:19)


" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#2 Le 01/05/2017, à 12:51

pingouinux

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Bonjour,
C'est vraisemblablement /usr/lib/python3.5 et non /usr/lib/python3.5/python3.5.

Hors ligne

#3 Le 01/05/2017, à 12:58

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

pingouinux a écrit :

Bonjour,
C'est vraisemblablement /usr/lib/python3.5 et non /usr/lib/python3.5/python3.5.

Merci, mais pas de changement avec: /usr/lib/python3.5

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /usr/lib/python3.5/ -m pip install shapely
[sudo] Mot de passe de serviteur : 
sudo: /usr/lib/python3.5/ : commande introuvable
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#4 Le 01/05/2017, à 13:09

pingouinux

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Je me suis trompé. C'est /usr/bin/python3.5 et non /usr/lib/python3.5.
Si ça ne marche pas, quel est le retour de cette commande

ls -ld /usr/bin/python*

Hors ligne

#5 Le 01/05/2017, à 13:18

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

pingouinux a écrit :

Je me suis trompé. C'est /usr/bin/python3.5 et non /usr/lib/python3.5.
Si ça ne marche pas, quel est le retour de cette commande

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /usr/bin/python3.5/ -m pip install shapely
[sudo] Mot de passe de serviteur : 
sudo: /usr/bin/python3.5/ : commande introuvable
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 
ls -ld /usr/bin/python*
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ ls -ld /usr/bin/python*
lrwxrwxrwx 1 root root       9 déc.  23 01:18 /usr/bin/python -> python2.7
lrwxrwxrwx 1 root root       9 déc.  23 01:18 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 3546104 nov.  19 10:35 /usr/bin/python2.7
lrwxrwxrwx 1 root root      33 nov.  19 10:35 /usr/bin/python2.7-config -> x86_64-linux-gnu-python2.7-config
lrwxrwxrwx 1 root root      16 déc.  10  2015 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root       9 déc.  23 01:18 /usr/bin/python3 -> python3.5
-rwxr-xr-x 1 root root 4460336 nov.  17 20:23 /usr/bin/python3.5
lrwxrwxrwx 1 root root      33 nov.  17 20:23 /usr/bin/python3.5-config -> x86_64-linux-gnu-python3.5-config
-rwxr-xr-x 1 root root 4460336 nov.  17 20:23 /usr/bin/python3.5m
lrwxrwxrwx 1 root root      34 nov.  17 20:23 /usr/bin/python3.5m-config -> x86_64-linux-gnu-python3.5m-config
lrwxrwxrwx 1 root root      16 mars  23  2016 /usr/bin/python3-config -> python3.5-config
lrwxrwxrwx 1 root root      10 déc.  23 01:18 /usr/bin/python3m -> python3.5m
lrwxrwxrwx 1 root root      17 mars  23  2016 /usr/bin/python3m-config -> python3.5m-config
lrwxrwxrwx 1 root root      16 déc.  10  2015 /usr/bin/python-config -> python2.7-config
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#6 Le 01/05/2017, à 13:21

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Pour:

ls -ld /usr/lib/python*
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ ls -ld /usr/lib/python*
drwxr-xr-x  3 root root  4096 nov.  24 22:36 /usr/lib/python2.6
drwxr-xr-x 27 root root 20480 nov.  24 22:09 /usr/lib/python2.7
drwxr-xr-x  3 root root  4096 nov.  10  2015 /usr/lib/python3
drwxr-xr-x 33 root root  4096 nov.  24 22:04 /usr/lib/python3.5
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#7 Le 01/05/2017, à 13:37

pingouinux

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Quel est le retour de

uname -a
file /usr/bin/python3.5

Hors ligne

#8 Le 01/05/2017, à 13:43

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

pingouinux a écrit :

Quel est le retour de

uname -a
file /usr/bin/python3.5

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ uname -a
Linux HP-EliteBook-8760w 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ file /usr/bin/python3.5
/usr/bin/python3.5: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=49562bd36cdc6d881700998330b1490e432e1382, stripped
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#9 Le 01/05/2017, à 14:12

pingouinux

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Ça y est, j'ai compris. Il ne faut pas laisser le "/" après la commande : /usr/bin/python3.5 et non /usr/bin/python3.5/

Hors ligne

#10 Le 01/05/2017, à 17:37

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

pingouinux a écrit :

Ça y est, j'ai compris. Il ne faut pas laisser le "/" après la commande : /usr/bin/python3.5 et non /usr/bin/python3.5/

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /usr/bin/python3.5 -m pip install shapely
[sudo] Mot de passe de serviteur : 
The directory '/home/serviteur/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/serviteur/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting shapely
  Downloading Shapely-1.5.17.post1-cp35-cp35m-manylinux1_x86_64.whl (8.3MB)
    100% |████████████████████████████████| 8.3MB 16kB/s 
Installing collected packages: shapely
Successfully installed shapely-1.5.17.post1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#11 Le 01/05/2017, à 17:46

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

https://github.com/s-leger/blenderPolygons/wiki/Setup a écrit :

To test the installation open Blender Python console and type
from shapely import geometry

Should you not find python under this path on your system, then open Blender's python console and type:

import sys
sys.path

Blender should report many path it does use. Find the one ending with /python3.5


Mon problème n'est pas toujours résolu.



from shapely import geometry

>> from shapely import geometry
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
ImportError: No module named 'shapely'

import sys
sys.path

>>> import sys
>>> sys.path
['/opt/blender/2.78/scripts/addons_contrib', '/home/serviteur/.config/blender/2.78/scripts/addons', '/opt/blender/2.78/scripts/addons', '/opt/blender/2.78/scripts/startup', '/opt/blender/2.78/scripts/modules', '/opt/blender/2.78/python/lib/python35.zip', '/opt/blender/2.78/python/lib/python3.5', '/opt/blender/2.78/python/lib/python3.5/plat-linux', '/opt/blender/2.78/python/lib/python3.5/lib-dynload', '/opt/blender/2.78/python/lib/python3.5/site-packages', '/opt/blender/2.78/scripts/freestyle/modules', '/opt/blender/2.78/scripts/addons/modules', '/home/serviteur/.config/blender/2.78/scripts/addons/modules']

>>>

Dernière modification par serviteur (Le 01/05/2017, à 17:46)


" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#12 Le 03/05/2017, à 23:25

s-leger

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

Bonjour,
Python 3.5 que blender utilise sur votre installation se situe dans le répertoire /opt/blender/2.78/python/lib/python3.5, d'après ce qu'il rapporte avec la commande sys.path

la commande pour y installer shapely devrait donc être :
sudo /opt/blender/2.78/python/lib/python3.5/python3.5 -m pip install shapely
ou
sudo /opt/blender/2.78/python/lib/python3.5/python -m pip install shapely

Normalement vous devriez être "armé" pour effectuer cette installation avec succès.

Hors ligne

#13 Le 04/05/2017, à 05:32

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

s-leger a écrit :

Bonjour,
Python 3.5 que blender utilise sur votre installation se situe dans le répertoire /opt/blender/2.78/python/lib/python3.5, d'après ce qu'il rapporte avec la commande sys.path

la commande pour y installer shapely devrait donc être :
sudo /opt/blender/2.78/python/lib/python3.5/python3.5 -m pip install shapely
ou
sudo /opt/blender/2.78/python/lib/python3.5/python -m pip install shapely

Normalement vous devriez être "armé" pour effectuer cette installation avec succès.


Merci s-leger, voici le retour des commandes:

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /opt/blender/2.78/python/lib/python3.5/python3.5 -m pip install shapely
[sudo] Mot de passe de serviteur : 
sudo: /opt/blender/2.78/python/lib/python3.5/python3.5 : commande introuvable
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ sudo /opt/blender/2.78/python/lib/python3.5/python -m pip install shapelysudo: /opt/blender/2.78/python/lib/python3.5/python : commande introuvable
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ 

" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne

#14 Le 07/05/2017, à 21:17

serviteur

Re : [RESOLU] Configurer python 3.5 pour Shapely (Addon Blender)

J'ai désinstaller l’installation manuel fait par ce lien:

- http://ubuntuhandbook.org/index.php/201 … se-ubuntu/
-https://www.youtube.com/watch?v=M83AZ14Pzu8


J'ai refait une installation à partir du PPA:

sudo add-apt-repository ppa:thomas-schiex/blender

python3.5 -m pip install shapely

serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶ python3.5 -m pip install shapely
Collecting shapely
  Downloading Shapely-1.5.17.post1-cp35-cp35m-manylinux1_x86_64.whl (8.3MB)
    100% |████████████████████████████████| 8.3MB 13kB/s 
Installing collected packages: shapely
Successfully installed shapely-1.5.17.post1
You are using pip version 8.1.1, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
serviteur @ HP-EliteBook-8760w  ~
└─ $ ▶

from shapely import geometry


>>> from shapely import geometry
>>>

L'addon Archipack 2d détecte maintenant les Polygones.

Discussion: https://blenderartists.org/forum/showth … ost3185935


" Le disciple (serviteur) n'est pas plus que le maître; mais tout disciple accompli sera comme son maître." Luc 6:40;  Jean. 13:16

HP EliteBook Workstation Intel i7 2760QM, 16GB RAM, Nvidia Quadro 4000M
HP Z8 G4  2X: Intel Xeon Silver 4108 CPU, 32 GB RAM, Nvidia Geforce RTX  2070 Super

Hors ligne