Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

747
Visualizações
python add-apt-repository: ImportError: No module named 'apt_pkg'

When I try:

sudo add-apt-repository ppa:kirillshkrogalev/ffmpeg-next

in Ubuntu, the terminal show this error message:

Traceback (most recent call last):
 File "/usr/bin/add-apt-repository", line 11, in <module>
    from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 27, in <module>
    import apt_pkg
ImportError: No module named 'apt_pkg'

I have two version of python, one is 2.7 the other is 3.5 .

How can I install this package on python3.5?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

I had something quite different than this. Mine failed with

No module named 'softwareproperties'

My solution is:

sudo vim /usr/bin/add-apt-repository
Change package header from `python3` to `python3.4` (or lower)

This may happen when you recently upgraded or added another python3 package.

over 4 years ago · Santiago Trujillo Relatório

0

ubuntu 18.04:

sudo vim /usr/bin/add-apt-repository

Change package header from python3 to python3.6

it's work for me

over 4 years ago · Santiago Trujillo Relatório

0

Just chiming in since the version numbers may have changed.

Summary of fix: pointing my python3 to python 3.5 instead of 3.6

cd /usr/bin
rm python3
ln -s python3.5 python3

Detail: I had this same problem and found that /usr/bin/add-apt-repository had a shebang hint to use /usr/bin/python3 which is pointing to 3.6. However I also have 3.5 on my system and have to toggle them often, so I toggled it back and add-apt-repository now works.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda