Python Forum
No module named 'ConfigParser'
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No module named 'ConfigParser'
#1
Hi,

When I want to install some pachakes, I have "ImportError: No module named 'ConfigParser'" error.
I use Python3.5 and used the below command to set it as a default python

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
e.g. to install setuptools I have the bellow error:
[Image: ppk_s1.jpg][Image: u909_s2.jpg]
I have also get the same error when I am going to install build-essential and python-dev for python-igraph as I discussed in this link.

I installed ConfigParser but I have yet the same errors:
[Image: e7df_c1.jpg]
Reply
#2
The ConfigParser module has been renamed to configparser in Python 3.
https://docs.python.org/2/library/configparser.html
Also it's build in and you don't need to install it from PyPi in Pythin 3.5.2. That is for those who want to backport the improved version in Py2 or pre py3.5 versions
Reply
#3
(May-20-2017, 06:29 AM)buran Wrote: The ConfigParser module has been renamed to configparser in Python 3.
https://docs.python.org/2/library/configparser.html
Also it's build in and you don't need to install it from PyPi in Pythin 3.5.2. That is for those who want to backport the improved version in Py2 or pre py3.5 versions
thanks for your reply...I am sorry. I don't exactly understand what should I do to install build-essential, python-dev and python-igraph without that error?
Reply
#4
As buran pointed out about the configparser being a built in, so is "setuptools", so you don't need to install that either.  As for python-dev, that is from your OS's repository.  It you are on a Debian or Ubuntu systen, it is probably apt-get install python-dev .  As for python-igraph, you should be able to do this: pip3 install-python-igraph . It's amazing what you can find when you read the docs http://igraph.org/python/ .
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
Reply
#5
(May-20-2017, 12:54 PM)sparkz_alot Wrote: As buran pointed out about the configparser being a built in, so is "setuptools", so you don't need to install that either.  As for python-dev, that is from your OS's repository.  It you are on a Debian or Ubuntu systen, it is probably apt-get install python-dev .  As for python-igraph, you should be able to do this: pip3 install-python-igraph . It's amazing what you can find when you read the docs http://igraph.org/python/ .
I use xubuntu.
As I said, I have the same error when installing those packages. e.g. for "python-dev" I have the bellow error:
[Image: bidr_python-dev.jpg]
I also try it with python3-dev:
[Image: 87mg_python3-dev.jpg]
Reply
#6
(May-20-2017, 05:35 AM)Bani Wrote: Hi,

When I want to install some pachakes, I have "ImportError: No module named 'ConfigParser'" error.
I use Python3.5 and used the below command to set it as a default python

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
Extremely dangerous thing to do. Try this:

Output:
find /usr -type f -executable -exec grep -Eo '#!.*python\w?' {} \; | sort | uniq -c       4 #! /usr/bin/env python      49 #!/usr/bin/env python       2 #!/usr/bin/env python2       9 #!/usr/bin/env python3     205 #! /usr/bin/python      86 #!/usr/bin/python      27 #! /usr/bin/python2       1 #!/usr/bin/python2      82 #! /usr/bin/python3      85 #!/usr/bin/python3
So, on my Linux, there are 293 Python scripts that are likely written for Python2 and that will suddenly be executed with Python3.
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply
#7
Hello!
The error is not for python-dev. It's the newest version in the repository. You can read it at the beginning of the output from the command.
Try to install pip python-igraph
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#8
(May-21-2017, 08:09 PM)Ofnuts Wrote:
(May-20-2017, 05:35 AM)Bani Wrote: Hi,

When I want to install some pachakes, I have "ImportError: No module named 'ConfigParser'" error.
I use Python3.5 and used the below command to set it as a default python

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
Extremely dangerous thing to do. Try this:

Output:
find /usr -type f -executable -exec grep -Eo '#!.*python\w?' {} \; | sort | uniq -c       4 #! /usr/bin/env python      49 #!/usr/bin/env python       2 #!/usr/bin/env python2       9 #!/usr/bin/env python3     205 #! /usr/bin/python      86 #!/usr/bin/python      27 #! /usr/bin/python2       1 #!/usr/bin/python2      82 #! /usr/bin/python3      85 #!/usr/bin/python3
So, on my Linux, there are 293 Python scripts that are likely written for Python2 and that will suddenly be executed with Python3.

thank you.
[Image: bxfe_capture2.jpg]
what should I do to solve this problem?

(May-22-2017, 04:35 AM)wavic Wrote: Hello!
The error is not for python-dev. It's the newest version in the repository. You can read it at the beginning of the output from the command.
Try to install pip python-igraph

I tried the command below but I have an error.
sudo pip3 install python-igraph

[Image: djom_1.jpg]
Reply
#9
Please, stop post screenshots. copy/paste terminal output in output tags
Reply
#10
(May-22-2017, 08:39 AM)Bani Wrote: what should I do to solve this problem?

Not use Python3 as the default. Reset the default to python2. If you need Python v3, 1) teach your fingers to use the python3 command, or use a "shebang" that mentions python3 in your scripts (plenty of examples above).
Unless noted otherwise, code in my posts should be understood as "coding suggestions", and its use may require more neurones than the two necessary for Ctrl-C/Ctrl-V.
Your one-stop place for all your GIMP needs: gimp-forum.net
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  no module named 'docx' when importing docx MaartenRo 1 894 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Problem with pymodbus - ModuleNotFoundError: No module named 'pymodbus.client.sync' stsxbel 2 23,819 Nov-02-2023, 08:20 AM
Last Post: South_east
  ModuleNotFoundError: No module named 'requests' Serg 18 2,605 Oct-29-2023, 11:33 PM
Last Post: Serg
  Resolving ImportError: No module named gdb (Python in C++) mandaxyz 3 1,465 Oct-04-2023, 02:43 PM
Last Post: mandaxyz
  ModuleNotFoundError: No module named 'PyPDF2' Benitta2525 1 1,525 Aug-07-2023, 05:32 AM
Last Post: DPaul
  ModuleNotFoundError: No module named 'eyed3' Wimpy_Wellington 2 1,350 Jul-10-2023, 03:37 AM
Last Post: Wimpy_Wellington
  How to fix this error: ModuleNotFoundError: No module named 'notears' yaoyao22 2 1,049 Jul-09-2023, 11:24 AM
Last Post: yaoyao22
  Help with pyinstaller "No module named" korenron 9 9,142 Jun-15-2023, 12:20 PM
Last Post: snippsat
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,020 May-15-2023, 02:38 PM
Last Post: tonynapoli2309
  ModuleNotFoundError: No module named 'omsdk.sdkproto' donvito7 4 1,871 Oct-20-2022, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020