<TIL - 0030> OSError: [WinError 123]

개발일지·2023년 4월 27일
0

til

목록 보기
30/43


OSError: [WinError 123]

장고 런서버 테스트 중 에러발생.

$ python manage.py runserver

...

OSError: [WinError 123] 파일 이름, 디렉터리 이름 또는 볼륨 레이블 구문이 잘못되었습니다: '<frozen importlib._bootstrap>'

부트스트랩..?
분명 어제까진 이상없었는데..?

구글링 결과.
settings.py > INSTALLED_APPS 에서 ,(콤마)를 누락하면 발생된다고한다.
아 별거아니었네~

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'rest_framework_simplejwt',
    'users',
]

어? 이상 없는데?

그럼 디렉토리 문제인가?
추가하거나 지운것도 없는데..

이거저거 뒤적거리다가 requirements.txt 확인.

asgiref==3.6.0
backports.zoneinfo==0.2.1
Django==4.2
djangorestframework==3.14.0
djangorestframework-simplejwt==5.2.2
PyJWT==2.6.0
pytz==2023.3
sqlparse==0.4.4
tzdata==2023.3

음.... hoxy?

$ pip list
Package                Version
---------------------- ---------
asgiref                3.6.0
astroid                2.15.2
attrs                  23.1.0
autopep8               2.0.2
backports.zoneinfo     0.2.1
certifi                2022.12.7
charset-normalizer     3.1.0
click                  8.1.3
colorama               0.4.6
coreapi                2.3.3
coreschema             0.0.4
dill                   0.3.6
Django                 4.2
django-filter          23.1
djangorestframework    3.14.0
dnspython              2.3.0
drf-yasg               1.21.5
Flask                  2.2.3
idna                   3.4
importlib-metadata     6.0.0
importlib-resources    5.12.0
inflection             0.5.1
isort                  5.12.0
itsdangerous           2.1.2
itypes                 1.2.0
Jinja2                 3.1.2
jsonschema             4.17.3
lazy-object-proxy      1.9.0
MarkupSafe             2.1.2
mccabe                 0.7.0
packaging              23.1
Pillow                 9.5.0
pip                    23.1.1
pkgutil_resolve_name   1.3.10
platformdirs           3.2.0
pycodestyle            2.10.0
pygame                 2.3.0
pylint                 2.17.2
pymongo                4.3.3
pyrsistent             0.19.3
pytz                   2023.3
PyYAML                 6.0
requests               2.28.2
ruamel.yaml            0.17.21
ruamel.yaml.clib       0.2.7
setuptools             49.2.1
sqlparse               0.4.3
swagger-spec-validator 3.0.3
tomli                  2.0.1
tomlkit                0.11.7
typing_extensions      4.5.0
tzdata                 2023.3
uritemplate            4.1.1
urllib3                1.26.15
Werkzeug               2.2.3
wrapt                  1.15.0
zipp                   3.15.0

어.... 뭐지? 난 이런걸 인스톨한적이 없는데요....
방법이 없을까..?

$ pip install -r requirements.txt
Requirement already satisfied: asgiref==3.6.0 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 1)) (3.6.0)
Requirement already satisfied: backports.zoneinfo==0.2.1 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 2)) (0.2.1)   
Requirement already satisfied: Django==4.2 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 3)) (4.2)
Requirement already satisfied: djangorestframework==3.14.0 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 4)) (3.14.0)
Collecting djangorestframework-simplejwt==5.2.2 (from -r requirements.txt (line 5))
  Using cached djangorestframework_simplejwt-5.2.2-py3-none-any.whl (85 kB)
Collecting PyJWT==2.6.0 (from -r requirements.txt (line 6))
  Using cached PyJWT-2.6.0-py3-none-any.whl (20 kB)
Requirement already satisfied: pytz==2023.3 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 7)) (2023.3)
Collecting sqlparse==0.4.4 (from -r requirements.txt (line 8))
  Using cached sqlparse-0.4.4-py3-none-any.whl (41 kB)
Requirement already satisfied: tzdata==2023.3 in c:\users\skinn\appdata\local\programs\python\python38\lib\site-packages (from -r requirements.txt (line 9)) (2023.3)
Installing collected packages: sqlparse, PyJWT, djangorestframework-simplejwt
  Attempting uninstall: sqlparse
    Found existing installation: sqlparse 0.4.3
    Uninstalling sqlparse-0.4.3:
      Successfully uninstalled sqlparse-0.4.3
Successfully installed PyJWT-2.6.0 djangorestframework-simplejwt-5.2.2 sqlparse-0.4.4

석세스? 누락되었었나..?
그럼 어제도 안돌아갔었어야하는거 아닌가..
아무튼 다시 서버를 돌려보자.

$ python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
April 27, 2023 - 13:34:43
Django version 4.2, using settings 'drf_project.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

된다!

남들처럼 ,하나 찍는걸로 오류가 해결된건 아니지만..
어쨌든 해결해서 다행이다.
단지 이거 하느라 걸린 시간이 처음부터 다시 한거보다 더 걸렸을 것 같다는게 문제..
근데 pip list가 왜 많아졌을까..?
저게 혹시 다른 문제를 일으키진 않을까..?
그건 다음에 알아보자..



profile
아닐지

0개의 댓글