Why does isort consider parser as built-in package?
              
              #2290
            
            
          -
| 
         
 import time
from parser import CategoryParser, TagParser  # <--- HERE
from typing import Tuple
from dateutil.parser import parse as parsedate
from loguru import logger
from data_types import CategoryResult, News, TagResult
from utils import clean_text | 
  
Beta Was this translation helpful? Give feedback.
      
      
          Answered by
          
            guillermodotn
          
      
      
        Mar 14, 2025 
      
    
    Replies: 1 comment 1 reply
-
| 
         Hello @secsilm, It depends on which Python version you are setting when using  isort --py 313 <name_of_your_file.py>This ensures that parser is correctly sorted for that Python version. Why does this happen? When you don't specify the Python version,   | 
  
Beta Was this translation helpful? Give feedback.
                  
                    1 reply
                  
                
            
      Answer selected by
        secsilm
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Hello @secsilm,
It depends on which Python version you are setting when using
isort. If you're running Python 3.13, you can try the following command:This ensures that parser is correctly sorted for that Python version.
Why does this happen?
When you don't specify the Python version,
isortcreates a set containing all standard library packages available across all Python 3.X versions. Since parser was removed in Python 3.10, it is still included whenisortconsiders older versions.