web-dev-qa-db-fra.com

Installer des en-têtes Python2.7 et 3 bras dans une machine à architecture AMD64

Je me bats parce que je veux compiler de manière croisée une application qui nécessite le Python à compiler. Juste au cas où vous seriez curieux de savoir que si le fichier pyconfig.h est utilisé, il essaie d’inclure le fichier suivant:

arm-linux-gnueabihf/python2.7/pyconfig.h

Ce qui malheureusement n'existe pas. Ensuite, j'aimerais installer les en-têtes python. J'ai donc procédé comme suit:

Sudo dpkg --add-architecture armhf
Sudo apt-get update

Et je reçois la sortie suivante,

Hit:2 http://ports.ubuntu.com/ubuntu-ports xenial InRelease                
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]             
Get:4 http://ports.ubuntu.com/ubuntu-ports xenial-security InRelease [107 kB]          
Hit:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease                      
Get:3 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]                       
Get:7 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [84.1 kB]     
Get:8 http://ports.ubuntu.com/ubuntu-ports xenial-security/main armhf Packages [514 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/main AMD64 Packages [668 kB]  
Get:10 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [587 kB]   
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]               
Ign:11 http://archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages           
Ign:12 http://archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages       
Get:13 http://ports.ubuntu.com/ubuntu-ports xenial-security/restricted armhf Packages [8480 B]
Get:14 http://ports.ubuntu.com/ubuntu-ports xenial-security/universe armhf Packages [375 kB]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/restricted AMD64 Packages [12.7 kB]
Get:16 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [12.7 kB]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/universe AMD64 Packages [455 kB]
Get:18 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [385 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]              
Get:20 http://archive.ubuntu.com/ubuntu xenial/main AMD64 Packages [1558 kB]    
Ign:21 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages                     
Get:22 http://archive.ubuntu.com/ubuntu xenial/restricted AMD64 Packages [14.1 kB]     
Ign:23 http://archive.ubuntu.com/ubuntu xenial/restricted armhf Packages               
Get:24 http://security.ubuntu.com/ubuntu xenial-security/multiverse AMD64 Packages [3738 B]
Ign:25 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Ign:25 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Ign:25 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages
Get:26 http://archive.ubuntu.com/ubuntu xenial/universe AMD64 Packages [9827 kB]
Err:25 http://security.ubuntu.com/ubuntu xenial-security/multiverse armhf Packages 
  404  Not Found [IP: 91.189.88.152 80]
Get:27 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages [9804 kB]
Get:28 http://archive.ubuntu.com/ubuntu xenial/multiverse AMD64 Packages [176 kB]
Ign:29 http://archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:11 http://archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:12 http://archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Get:30 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [261 kB]
Get:31 http://archive.ubuntu.com/ubuntu xenial-updates/main AMD64 Packages [1046 kB]
Ign:32 http://archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Get:33 http://archive.ubuntu.com/ubuntu xenial-updates/restricted AMD64 Packages [13.1 kB]
Ign:34 http://archive.ubuntu.com/ubuntu xenial-updates/restricted armhf Packages
Get:35 http://archive.ubuntu.com/ubuntu xenial-updates/universe AMD64 Packages [829 kB]
Ign:36 http://archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Get:37 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse AMD64 Packages [18.8 kB]
Ign:38 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:21 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:23 http://archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:29 http://archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Ign:11 http://archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
Ign:12 http://archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:32 http://archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:34 http://archive.ubuntu.com/ubuntu xenial-updates/restricted armhf Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Ign:21 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages
Ign:23 http://archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:29 http://archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Err:11 http://archive.ubuntu.com/ubuntu xenial-backports/main armhf Packages
  404  Not Found [IP: 91.189.88.149 80]
Ign:12 http://archive.ubuntu.com/ubuntu xenial-backports/universe armhf Packages
Ign:32 http://archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
Ign:34 http://archive.ubuntu.com/ubuntu xenial-updates/restricted armhf Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Err:21 http://archive.ubuntu.com/ubuntu xenial/main armhf Packages
  404  Not Found [IP: 91.189.88.149 80]
Ign:23 http://archive.ubuntu.com/ubuntu xenial/restricted armhf Packages
Ign:29 http://archive.ubuntu.com/ubuntu xenial/multiverse armhf Packages
Err:32 http://archive.ubuntu.com/ubuntu xenial-updates/main armhf Packages
  404  Not Found [IP: 91.189.88.149 80]
Ign:34 http://archive.ubuntu.com/ubuntu xenial-updates/restricted armhf Packages
Ign:36 http://archive.ubuntu.com/ubuntu xenial-updates/universe armhf Packages
Ign:38 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse armhf Packages
Fetched 2452 kB in 2s (1020 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-armhf/Packages  404  Not Found [IP: 91.189.88.149 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/multiverse/binary-armhf/Packages  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/main/binary-armhf/Packages  404  Not Found [IP: 91.189.88.149 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-armhf/Packages  404  Not Found [IP: 91.189.88.149 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

J'ai cherché sur Internet et beaucoup de gens ont dit que la solution consistait à différencier dans le fichier /etc/apt/sources.list les référentiels des architectures Armhf et ceux correspondant à AMD64, i386. Cela ne marche pas du tout (et je ne sais pas si je l'ai bien fait, je ne sais pas grand chose à propos de sources.list), quand j'exécute cette commande:

Sudo apt-get install libpython2.7-dev:armhf

Je reçois:

    The following packages have unmet dependencies:
 libpython2.7-dev:armhf : Depends: libpython2.7-stdlib:armhf (= 2.7.12-1ubuntu0~16.04.2) but it is not going to be installed
                          Depends: libpython2.7:armhf (= 2.7.12-1ubuntu0~16.04.2) but it is not going to be installed
                          Depends: libexpat1-dev:armhf but it is not going to be installed
                          Recommends: libc6-dev:armhf but it is not going to be installed or
                                      libc-dev:armhf
E: Unable to correct problems, you have held broken packages

Savez-vous à quelle étape je me suis planté? Je ne suis pas sûr, j'apprécierai votre aide, merci.

2
Marc43

Je ne pouvais pas résoudre ce problème mais j'ai réussi à compiler, le pyconf.h nécessitant le arm-linux-gnueabihf-hf pyconf.h, j'ai donc installé dans mon périphérique ARM les python2.7 et python3.5 paquets de développement (python-dev et python3-dev) et copiés sur mon PC à l’emplacement où ils recherchaient ces fichiers pyconf.h. N'est-ce pas élégant, je ne l'aime pas, mais ça marche.

1
Marc43