question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"ImportError: No module named configparser" error on Python 2.7.13

See original GitHub issue

I’ve added one task to launchd on Mac and during executing it I have an error which provided below:

Traceback (most recent call last):
  File "/Users/develsites/packt_grabber/src/packtPublishingFreeEbook.py", line 10, in <module>
    import configparser
ImportError: No module named configparser

If I run the script inside in the src folder directly in terminal then it works correctly.

How to solve this issue? Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
mjenczmykcommented, Sep 3, 2017

My first guess is that it’s because such package does not exist in Python 2.7 - we can either import if from six or import it like below. I’ll make a pull request at most that evening and add you as a reviewer.

if sys.version_info[0] == 2:
    import ConfigParser as configparser
else:
    import configparser
0reactions
develsitescommented, Sep 4, 2017

Thank everybody for helping 😉 The issue has been solved. The reason was different paths to the Python binary (one was system-wide installed and one installed from brew). Because I use some shell script which is using different binaries.

Thanks so much for everybody 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

python 2.7: no module named configparser - Stack Overflow
I'm trying to run db_create.py in Flask, and am getting the following error:
Read more >
ImportError: No module named configparser - julienprog
It means that the instruction “from” will load the module configparser. “configparser” is python3 specific module according to this link https: ...
Read more >
How to Solve ImportError: No module named ConfigParser?
It means, you have to install ConfigParser module. I suggest you to install Python PIP, which allows you to install modules quite easily....
Read more >
python - Python3 virtualenv: ImportError: no module named ...
What solved the problem for me was just removing the configparser.py file from that directory, since that wasn't the configparser that ...
Read more >
[Solved] No Module Named Configparser - Encoding Compiler
The error says that the “packstack” command cannot load the Python module named “ConfigParser.” For installing the “ConfigParser” module, we have to install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found