ModuleNotFoundError: No module named 'apt_pkg' error












2















I run below command on ubuntu 16.4 :



sudo add-apt-repository ppa:noobslab/apps



of below question:



How to install PlayOnLinux on Ubuntu 16.04



and get below error:



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
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
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
ModuleNotFoundError: No module named 'apt_pkg'


Thanks for help










share|improve this question

























  • Try reinstalling the python3-software-properties package. It provides the missing module.

    – user535733
    Aug 26 '18 at 12:59











  • Thanks . how reinstalling ?

    – Mostafa Norzade
    Aug 26 '18 at 13:00











  • If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

    – user535733
    Aug 26 '18 at 13:02













  • Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

    – Mostafa Norzade
    Aug 26 '18 at 13:07













  • Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

    – N0rbert
    Aug 26 '18 at 14:11
















2















I run below command on ubuntu 16.4 :



sudo add-apt-repository ppa:noobslab/apps



of below question:



How to install PlayOnLinux on Ubuntu 16.04



and get below error:



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
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
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
ModuleNotFoundError: No module named 'apt_pkg'


Thanks for help










share|improve this question

























  • Try reinstalling the python3-software-properties package. It provides the missing module.

    – user535733
    Aug 26 '18 at 12:59











  • Thanks . how reinstalling ?

    – Mostafa Norzade
    Aug 26 '18 at 13:00











  • If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

    – user535733
    Aug 26 '18 at 13:02













  • Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

    – Mostafa Norzade
    Aug 26 '18 at 13:07













  • Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

    – N0rbert
    Aug 26 '18 at 14:11














2












2








2








I run below command on ubuntu 16.4 :



sudo add-apt-repository ppa:noobslab/apps



of below question:



How to install PlayOnLinux on Ubuntu 16.04



and get below error:



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
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
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
ModuleNotFoundError: No module named 'apt_pkg'


Thanks for help










share|improve this question
















I run below command on ubuntu 16.4 :



sudo add-apt-repository ppa:noobslab/apps



of below question:



How to install PlayOnLinux on Ubuntu 16.04



and get below error:



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
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

Original exception was:
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
ModuleNotFoundError: No module named 'apt_pkg'


Thanks for help







16.04 dpkg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 26 '18 at 15:52







Mostafa Norzade

















asked Aug 26 '18 at 12:56









Mostafa NorzadeMostafa Norzade

1116




1116













  • Try reinstalling the python3-software-properties package. It provides the missing module.

    – user535733
    Aug 26 '18 at 12:59











  • Thanks . how reinstalling ?

    – Mostafa Norzade
    Aug 26 '18 at 13:00











  • If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

    – user535733
    Aug 26 '18 at 13:02













  • Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

    – Mostafa Norzade
    Aug 26 '18 at 13:07













  • Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

    – N0rbert
    Aug 26 '18 at 14:11



















  • Try reinstalling the python3-software-properties package. It provides the missing module.

    – user535733
    Aug 26 '18 at 12:59











  • Thanks . how reinstalling ?

    – Mostafa Norzade
    Aug 26 '18 at 13:00











  • If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

    – user535733
    Aug 26 '18 at 13:02













  • Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

    – Mostafa Norzade
    Aug 26 '18 at 13:07













  • Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

    – N0rbert
    Aug 26 '18 at 14:11

















Try reinstalling the python3-software-properties package. It provides the missing module.

– user535733
Aug 26 '18 at 12:59





Try reinstalling the python3-software-properties package. It provides the missing module.

– user535733
Aug 26 '18 at 12:59













Thanks . how reinstalling ?

– Mostafa Norzade
Aug 26 '18 at 13:00





Thanks . how reinstalling ?

– Mostafa Norzade
Aug 26 '18 at 13:00













If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

– user535733
Aug 26 '18 at 13:02







If you don't know how to reinstall a package, then you may not be prepared to manage PPAs yet, so make sure you maintain good backups of your data. Open a terminal: sudo apt install --reinstall <package name>

– user535733
Aug 26 '18 at 13:02















Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

– Mostafa Norzade
Aug 26 '18 at 13:07







Thanks . i run sudo apt install --reinstall python3-software-properties but Still the problem persists

– Mostafa Norzade
Aug 26 '18 at 13:07















Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

– N0rbert
Aug 26 '18 at 14:11





Try to reinstall two other packages: sudo apt-get install --reinstall python-apt python3-apt.

– N0rbert
Aug 26 '18 at 14:11










1 Answer
1






active

oldest

votes


















0














There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me.



sudo apt-get remove python3-apt
sudo apt-get install python3-apt





share|improve this answer
























  • Thanks . now I have bleow error : sudo: add-apt-repository: command not found

    – Mostafa Norzade
    Aug 28 '18 at 12:02













  • I am having the exactly same issue. Any fix?

    – David Simic
    Nov 14 '18 at 23:46











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1069087%2fmodulenotfounderror-no-module-named-apt-pkg-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me.



sudo apt-get remove python3-apt
sudo apt-get install python3-apt





share|improve this answer
























  • Thanks . now I have bleow error : sudo: add-apt-repository: command not found

    – Mostafa Norzade
    Aug 28 '18 at 12:02













  • I am having the exactly same issue. Any fix?

    – David Simic
    Nov 14 '18 at 23:46
















0














There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me.



sudo apt-get remove python3-apt
sudo apt-get install python3-apt





share|improve this answer
























  • Thanks . now I have bleow error : sudo: add-apt-repository: command not found

    – Mostafa Norzade
    Aug 28 '18 at 12:02













  • I am having the exactly same issue. Any fix?

    – David Simic
    Nov 14 '18 at 23:46














0












0








0







There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me.



sudo apt-get remove python3-apt
sudo apt-get install python3-apt





share|improve this answer













There was a similar question on 2014 (Problem with update-manager: No module named 'apt_pkg' in Ubuntu 13.10, having installed Python 3.4 on /usr/local/lib). The solution worked for me.



sudo apt-get remove python3-apt
sudo apt-get install python3-apt






share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 28 '18 at 10:50









Felix SchieggFelix Schiegg

11




11













  • Thanks . now I have bleow error : sudo: add-apt-repository: command not found

    – Mostafa Norzade
    Aug 28 '18 at 12:02













  • I am having the exactly same issue. Any fix?

    – David Simic
    Nov 14 '18 at 23:46



















  • Thanks . now I have bleow error : sudo: add-apt-repository: command not found

    – Mostafa Norzade
    Aug 28 '18 at 12:02













  • I am having the exactly same issue. Any fix?

    – David Simic
    Nov 14 '18 at 23:46

















Thanks . now I have bleow error : sudo: add-apt-repository: command not found

– Mostafa Norzade
Aug 28 '18 at 12:02







Thanks . now I have bleow error : sudo: add-apt-repository: command not found

– Mostafa Norzade
Aug 28 '18 at 12:02















I am having the exactly same issue. Any fix?

– David Simic
Nov 14 '18 at 23:46





I am having the exactly same issue. Any fix?

– David Simic
Nov 14 '18 at 23:46


















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1069087%2fmodulenotfounderror-no-module-named-apt-pkg-error%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?