Python 3.x ImportError: No module named configparser , but module is installed
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
In my code i am using configparser. Everything working fine, but after i do fresh install of windows 10, this error appears: ImportError: No module named configparser
.
- But same code working on other pc
- Python is in PATH (double checked)
- Try reinstall python
- configparser is installed by default, but still try "pip install configparser"
I am using Python 3.7.1
In same code i do "import os
" and this is working. Configparser is in same directory.
EDIT:
configparser is here:
c:Program FilesPython37Libconfigparser.py
after pip install configparser
, there is another:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
EDIT_2:
Try copy:
c:Program FilesPython37Libconfigparser.py
to my working folder. Result:
Traceback (most recent call last):
File "C:gitsilixcon_libproduction_data.py", line 4, in <module>
import configparser
File "C:gitsilixcon_libconfigparser.py", line 434
option, section, rawval, var) from None
^
SyntaxError: invalid syntax
This is working:
Copy this to my working folder:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
and rename it to configparser.py. At lines 138-140 change "backports.configparser.helpers" to "helpers"
and this copy too:
c:Program FilesPython37Libsite-packagesbackportsconfigparserhelpers.py
python windows configparser python-3.7
|
show 1 more comment
In my code i am using configparser. Everything working fine, but after i do fresh install of windows 10, this error appears: ImportError: No module named configparser
.
- But same code working on other pc
- Python is in PATH (double checked)
- Try reinstall python
- configparser is installed by default, but still try "pip install configparser"
I am using Python 3.7.1
In same code i do "import os
" and this is working. Configparser is in same directory.
EDIT:
configparser is here:
c:Program FilesPython37Libconfigparser.py
after pip install configparser
, there is another:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
EDIT_2:
Try copy:
c:Program FilesPython37Libconfigparser.py
to my working folder. Result:
Traceback (most recent call last):
File "C:gitsilixcon_libproduction_data.py", line 4, in <module>
import configparser
File "C:gitsilixcon_libconfigparser.py", line 434
option, section, rawval, var) from None
^
SyntaxError: invalid syntax
This is working:
Copy this to my working folder:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
and rename it to configparser.py. At lines 138-140 change "backports.configparser.helpers" to "helpers"
and this copy too:
c:Program FilesPython37Libsite-packagesbackportsconfigparserhelpers.py
python windows configparser python-3.7
1
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
May I see the output ofpip show configparser
– stovfl
Nov 8 '18 at 18:58
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser
– Matouš Čmelík
Nov 12 '18 at 7:11
pip show configparser
Have no output...
– Matouš Čmelík
Nov 12 '18 at 7:15
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're usingpip
for the wrong one. Try using some virtual environment
– Novak
Nov 12 '18 at 8:10
|
show 1 more comment
In my code i am using configparser. Everything working fine, but after i do fresh install of windows 10, this error appears: ImportError: No module named configparser
.
- But same code working on other pc
- Python is in PATH (double checked)
- Try reinstall python
- configparser is installed by default, but still try "pip install configparser"
I am using Python 3.7.1
In same code i do "import os
" and this is working. Configparser is in same directory.
EDIT:
configparser is here:
c:Program FilesPython37Libconfigparser.py
after pip install configparser
, there is another:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
EDIT_2:
Try copy:
c:Program FilesPython37Libconfigparser.py
to my working folder. Result:
Traceback (most recent call last):
File "C:gitsilixcon_libproduction_data.py", line 4, in <module>
import configparser
File "C:gitsilixcon_libconfigparser.py", line 434
option, section, rawval, var) from None
^
SyntaxError: invalid syntax
This is working:
Copy this to my working folder:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
and rename it to configparser.py. At lines 138-140 change "backports.configparser.helpers" to "helpers"
and this copy too:
c:Program FilesPython37Libsite-packagesbackportsconfigparserhelpers.py
python windows configparser python-3.7
In my code i am using configparser. Everything working fine, but after i do fresh install of windows 10, this error appears: ImportError: No module named configparser
.
- But same code working on other pc
- Python is in PATH (double checked)
- Try reinstall python
- configparser is installed by default, but still try "pip install configparser"
I am using Python 3.7.1
In same code i do "import os
" and this is working. Configparser is in same directory.
EDIT:
configparser is here:
c:Program FilesPython37Libconfigparser.py
after pip install configparser
, there is another:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
EDIT_2:
Try copy:
c:Program FilesPython37Libconfigparser.py
to my working folder. Result:
Traceback (most recent call last):
File "C:gitsilixcon_libproduction_data.py", line 4, in <module>
import configparser
File "C:gitsilixcon_libconfigparser.py", line 434
option, section, rawval, var) from None
^
SyntaxError: invalid syntax
This is working:
Copy this to my working folder:
c:Program FilesPython37Libsite-packagesbackportsconfigparser__init__.py
and rename it to configparser.py. At lines 138-140 change "backports.configparser.helpers" to "helpers"
and this copy too:
c:Program FilesPython37Libsite-packagesbackportsconfigparserhelpers.py
python windows configparser python-3.7
python windows configparser python-3.7
edited Nov 16 '18 at 17:12
Matouš Čmelík
asked Nov 8 '18 at 16:38
Matouš ČmelíkMatouš Čmelík
11
11
1
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
May I see the output ofpip show configparser
– stovfl
Nov 8 '18 at 18:58
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser
– Matouš Čmelík
Nov 12 '18 at 7:11
pip show configparser
Have no output...
– Matouš Čmelík
Nov 12 '18 at 7:15
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're usingpip
for the wrong one. Try using some virtual environment
– Novak
Nov 12 '18 at 8:10
|
show 1 more comment
1
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
May I see the output ofpip show configparser
– stovfl
Nov 8 '18 at 18:58
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser
– Matouš Čmelík
Nov 12 '18 at 7:11
pip show configparser
Have no output...
– Matouš Čmelík
Nov 12 '18 at 7:15
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're usingpip
for the wrong one. Try using some virtual environment
– Novak
Nov 12 '18 at 8:10
1
1
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
May I see the output of
pip show configparser
– stovfl
Nov 8 '18 at 18:58
May I see the output of
pip show configparser
– stovfl
Nov 8 '18 at 18:58
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser– Matouš Čmelík
Nov 12 '18 at 7:11
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser– Matouš Čmelík
Nov 12 '18 at 7:11
pip show configparser
Have no output...– Matouš Čmelík
Nov 12 '18 at 7:15
pip show configparser
Have no output...– Matouš Čmelík
Nov 12 '18 at 7:15
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're using
pip
for the wrong one. Try using some virtual environment– Novak
Nov 12 '18 at 8:10
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're using
pip
for the wrong one. Try using some virtual environment– Novak
Nov 12 '18 at 8:10
|
show 1 more comment
1 Answer
1
active
oldest
votes
Found cause
During instalation Platformio-ide to Atom editor, python 2.7 was installed. Python 3.7 was in path and when i run:
python -V
I see my python 3.7 version. Bud when i run python script it starts in python 2.7.
But this:
python my_script.py
starts python 3.7.
So problem is in association .py file extension. But for unknown reason a can not change .py to run in python 3.7. So for now i uninstall platformio and everything starts working.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212248%2fpython-3-x-importerror-no-module-named-configparser-but-module-is-installed%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
Found cause
During instalation Platformio-ide to Atom editor, python 2.7 was installed. Python 3.7 was in path and when i run:
python -V
I see my python 3.7 version. Bud when i run python script it starts in python 2.7.
But this:
python my_script.py
starts python 3.7.
So problem is in association .py file extension. But for unknown reason a can not change .py to run in python 3.7. So for now i uninstall platformio and everything starts working.
add a comment |
Found cause
During instalation Platformio-ide to Atom editor, python 2.7 was installed. Python 3.7 was in path and when i run:
python -V
I see my python 3.7 version. Bud when i run python script it starts in python 2.7.
But this:
python my_script.py
starts python 3.7.
So problem is in association .py file extension. But for unknown reason a can not change .py to run in python 3.7. So for now i uninstall platformio and everything starts working.
add a comment |
Found cause
During instalation Platformio-ide to Atom editor, python 2.7 was installed. Python 3.7 was in path and when i run:
python -V
I see my python 3.7 version. Bud when i run python script it starts in python 2.7.
But this:
python my_script.py
starts python 3.7.
So problem is in association .py file extension. But for unknown reason a can not change .py to run in python 3.7. So for now i uninstall platformio and everything starts working.
Found cause
During instalation Platformio-ide to Atom editor, python 2.7 was installed. Python 3.7 was in path and when i run:
python -V
I see my python 3.7 version. Bud when i run python script it starts in python 2.7.
But this:
python my_script.py
starts python 3.7.
So problem is in association .py file extension. But for unknown reason a can not change .py to run in python 3.7. So for now i uninstall platformio and everything starts working.
answered Nov 16 '18 at 17:13
Matouš ČmelíkMatouš Čmelík
11
11
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- 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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53212248%2fpython-3-x-importerror-no-module-named-configparser-but-module-is-installed%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
1
Could you share the code snippet of what is going wrong.
– kaleem231
Nov 8 '18 at 16:41
May I see the output of
pip show configparser
– stovfl
Nov 8 '18 at 18:58
#!/usr/bin/python
import configparser
import os
import fnmatch
Traceback (most recent call last): File "C:gitsilixcon_libproduction_data.py", line 4, in <module> import configparser ImportError: No module named configparser– Matouš Čmelík
Nov 12 '18 at 7:11
pip show configparser
Have no output...– Matouš Čmelík
Nov 12 '18 at 7:15
If you have more then one version of python installed on your machine or you have the same version but one is system one and the other you installed manually, maybe you're using
pip
for the wrong one. Try using some virtual environment– Novak
Nov 12 '18 at 8:10