Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing some packages and can not import coreapi from restframeword library #819

Open
AliMohammadinezhad opened this issue Jul 30, 2024 · 0 comments

Comments

@AliMohammadinezhad
Copy link

below is the error message:

backend  | Watching for file changes with StatReloader
backend  | Performing system checks...
backend  |                                                                                  
backend  | Exception in thread django-main-thread:                                          
backend  | Traceback (most recent call last):
backend  |   File "/usr/local/lib/python3.11/threading.py", line 1045, in _bootstrap_inner  
backend  |     self.run()                                                                   
backend  |   File "/usr/local/lib/python3.11/threading.py", line 982, in run                
backend  |     self._target(*self._args, **self._kwargs)                                    
backend  |   File "/usr/local/lib/python3.11/site-packages/django/utils/autoreload.py", line 64, in wrapper                                                                             
backend  |     fn(*args, **kwargs)
backend  |   File "/usr/local/lib/python3.11/site-packages/django/core/management/commands/runserver.py", line 133, in inner_run                                                        
backend  |     self.check(display_num_errors=True)
backend  |   File "/usr/local/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check                                                                          
backend  |     all_issues = checks.run_checks(
backend  |                  ^^^^^^^^^^^^^^^^^^                                              
backend  |   File "/usr/local/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks                                                                      
backend  |     new_errors = check(app_configs=app_configs, databases=databases)
backend  |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^             
backend  |   File "/usr/local/lib/python3.11/site-packages/django/core/checks/urls.py", line 14, in check_url_config
backend  |     return check_resolver(resolver)
backend  |            ^^^^^^^^^^^^^^^^^^^^^^^^                                              
backend  |   File "/usr/local/lib/python3.11/site-packages/django/core/checks/urls.py", line 24, in check_resolver                                                                      
backend  |     return check_method()
backend  |            ^^^^^^^^^^^^^^                                                        
backend  |   File "/usr/local/lib/python3.11/site-packages/django/urls/resolvers.py", line 494, in check                                                                                
backend  |     for pattern in self.url_patterns:
backend  |                    ^^^^^^^^^^^^^^^^^                                             
backend  |   File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__                                                                             
backend  |     res = instance.__dict__[self.name] = self.func(instance)
backend  |                                          ^^^^^^^^^^^^^^^^^^^                     
backend  |   File "/usr/local/lib/python3.11/site-packages/django/urls/resolvers.py", line 715, in url_patterns                                                                         
backend  |     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
backend  |                        ^^^^^^^^^^^^^^^^^^^                                       
backend  |   File "/usr/local/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__                                                                             
backend  |     res = instance.__dict__[self.name] = self.func(instance)
backend  |                                          ^^^^^^^^^^^^^^^^^^^                     
backend  |   File "/usr/local/lib/python3.11/site-packages/django/urls/resolvers.py", line 708, in urlconf_module                                                                       
backend  |     return import_module(self.urlconf_name)
backend  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                      
backend  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module                                                                                         
backend  |     return _bootstrap._gcd_import(name[level:], package, level)
backend  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                  
backend  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import                
backend  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load             
backend  |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked    
backend  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked              
backend  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module
backend  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed   
backend  |   File "/app/core/urls.py", line 31, in <module>                                 
backend  |     path("accounts/", include("accounts.urls")),                                 
backend  |                       ^^^^^^^^^^^^^^^^^^^^^^^^                                   
backend  |   File "/usr/local/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include                                                                                    
backend  |     urlconf_module = import_module(urlconf_module)
backend  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                               
backend  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module                                                                                         
backend  |     return _bootstrap._gcd_import(name[level:], package, level)
backend  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import                
backend  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load             
backend  |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked    
backend  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked              
backend  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module        
backend  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed   
backend  |   File "/app/accounts/urls.py", line 7, in <module>                              
backend  |     path("api/v1/", include('accounts.api.v1.urls'))                             
backend  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend  |   File "/usr/local/lib/python3.11/site-packages/django/urls/conf.py", line 38, in include                                                                                    
backend  |     urlconf_module = import_module(urlconf_module)
backend  |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                               
backend  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module                                                                                         
backend  |     return _bootstrap._gcd_import(name[level:], package, level)
backend  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import                
backend  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load             
backend  |   File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked    
backend  |   File "<frozen importlib._bootstrap>", line 690, in _load_unlocked              
backend  |   File "<frozen importlib._bootstrap_external>", line 940, in exec_module        
backend  |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
backend  |   File "/app/accounts/api/v1/urls.py", line 5, in <module>                       
backend  |     from . import views                                                          
backend  |   File "/app/accounts/api/v1/views.py", line 4, in <module>                      
backend  |     from rest_framework.authtoken.views import ObtainAuthToken                   
backend  |   File "/usr/local/lib/python3.11/site-packages/rest_framework/authtoken/views.py", line 11, in <module>                                                                     
backend  |     class ObtainAuthToken(APIView):
backend  |   File "/usr/local/lib/python3.11/site-packages/rest_framework/authtoken/views.py", line 21, in ObtainAuthToken                                                              
backend  |     coreapi.Field(
backend  |     ^^^^^^^^^^^^^                                                                
backend  | AttributeError: 'NoneType' object has no attribute 'Field'                       
                                                                                            

I tried this with different versions of rest framework such as 3.12, 3.13, 3.14, 3.15. and my django version in requirements is django>4.2,<4.3
and there is no other packages. I just used Django, Django restframework and Django restframework simple jwt package.
if anyone know the issue please help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant