Python Forum
No module named 'ConfigParser' - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: No module named 'ConfigParser' (/thread-3399.html)

Pages: 1 2


No module named 'ConfigParser' - Bani - May-20-2017

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]


RE: No module named 'ConfigParser' - buran - May-20-2017

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


RE: No module named 'ConfigParser' - Bani - May-20-2017

(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?


RE: No module named 'ConfigParser' - sparkz_alot - May-20-2017

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/ .


RE: No module named 'ConfigParser' - Bani - May-20-2017

(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]


RE: No module named 'ConfigParser' - Ofnuts - May-21-2017

(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.


RE: No module named 'ConfigParser' - wavic - May-22-2017

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


RE: No module named 'ConfigParser' - Bani - May-22-2017

(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]


RE: No module named 'ConfigParser' - buran - May-22-2017

Please, stop post screenshots. copy/paste terminal output in output tags


RE: No module named 'ConfigParser' - Ofnuts - May-22-2017

(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).