4-07 ImportError: cannot import name 'fromshare' from 'socket' 오류
선생님 안녕하세요
4-07 에서 데이터베이스 생성하기 전에 장고를 실행하면
아래와 같이 에러가 뜹니다.
인터넷을 검색해봐도 답이 잘 안나오는데 어떻게 해결해야 하는게 좋을지 말씀 부탁드립니다.!
(mysite) ubuntu@pybomaster:~/projects/mysite$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/usr/lib/python3.8/threading.py", line 870, in run
self._target(self._args, self._kwargs)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(args, **kwargs)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 134, in inner_run
self.check(display_num_errors=True)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/core/management/base.py", line 487, in check
all_issues = checks.run_checks(
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/core/checks/urls.py", line 14, in check_url_config
return check_resolver(resolver)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/core/checks/urls.py", line 24, in check_resolver
return check_method()
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/urls/resolvers.py", line 480, in check
for pattern in self.url_patterns:
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/urls/resolvers.py", line 696, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/utils/functional.py", line 49, in get
res = instance.dict[self.name] = self.func(instance)
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/urls/resolvers.py", line 689, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
File "
File "
File "
File "
File "
File "/home/ubuntu/projects/mysite/config/urls.py", line 26, in
path('pybo/', include('pybo.urls')), # url이 pybo/ ~ 인 경우, pybo/urls.py 로 연결하라는 뜻.
File "/home/ubuntu/venvs/mysite/lib/python3.8/site-packages/django/urls/conf.py", line 38, in include
urlconf_module = import_module(urlconf_module)
File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
File "
File "
File "
File "
File "
File "/home/ubuntu/projects/mysite/pybo/urls.py", line 4, in
from .views import base_views, question_views, answer_views
File "/home/ubuntu/projects/mysite/pybo/views/question_views.py", line 6, in
from ..forms import QuestionForm
File "/home/ubuntu/projects/mysite/pybo/forms.py", line 1, in
from socket import fromshare
ImportError: cannot import name 'fromshare' from 'socket' (/usr/lib/python3.8/socket.py)
nathanpark 님 755
2022년 8월 26일 2:44 오전
1개의 답변이 있습니다. 1 / 1 Page
fromshare module은 windows OS에서만 지원합니다.
참고 : https://docs.python.org/3/library/socket.html
TAO 님
2022년 9월 1일 11:33 오전