NameError: global name 'NoSectionError' is not defined under Python 2.7
See original GitHub issueI get this exception being raised when I call pip-upgrade
with Python2.7. The problem is in pip_upgrader/packages_status_detector.py", line 80
:
try:
from configparser import ConfigParser, NoOptionError, NoSectionError
except ImportError: # pragma: nocover
from ConfigParser import ConfigParser, NoOptionError
[…]
except (NoOptionError, NoSectionError): # pragma: nocover
If you have ConfigParser
then the NoSectionError
exception is not imported thus the above error.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Python 2.7 Global name not defined - Stack Overflow
Indeed you never defined name R . Fix that by replacing: for j in range(n2): R[j] = numbers[m+j+1]. with: R = [numbers[m+j+1] for...
Read more >How to Setup Your Python Environment for Machine Learning ...
In this tutorial, you will discover how to set up a Python ... Keras: when I try to print it says “NameError: name...
Read more >ConfigParser – Work with configuration files - PyMOTW
It consists of one or more named sections, each of which can contain individual options with names and values. Config file sections are...
Read more >class 'ConfigParser.NoSectionError'
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they...
Read more >Index — Python 3.11.1 documentation
python --m-py_compile command line option. - (minus). binary operator, [1] · in ... --no-type-comments ... --with-framework-name. command line option.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, no problem 😄
Changing
from ConfigParser import ConfigParser, NoOptionError
to
from ConfigParser import ConfigParser, NoOptionError, NoSectionError
fixed it for me.