2

I've been struggling around because I want to cross-compile an application which needs the Python to compile. Just in case you are curious the case is that when it goes to the pyconfig.h it tries to do the include of the following file:

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

Which unfortunately does not exist. Then, I would like to install the python headers, so I did the following:

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

And I get the following output,

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.

I searched on internet and many people said that the solution is to differentiate in the /etc/apt/sources.list which repositories are for armhf architectures and which ones are for amd64,i386. This doesn't work at all (also I don't know if I did it good, I don't know much about sources.list), When I execute this command:

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

I get:

    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

Do you know in which step I messed all up? I am not sure, I will appreciate your help, Thank you.

1

I could not solve this but I managed to compile, the pyconf.h was requiring the arm-linux-gnueabihf-hf pyconf.h, so I installed in my ARM device the python2.7 and python3.5 development packages (python-dev and python3-dev) and the copìed back to my PC at the location it was looking for these pyconf.h files. Is not elegant, I don't like it, but it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.