커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
mongodb 연결을 했는데 Browse Collections에 users가 안뜹니다
undefined주차
북마크
우*현
댓글
8
추천
0
조회수
13
조회수
13
답변 완료

* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.

* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.


mongodb connect도 완료했고 코드 입력 및 저장도 했는데 users가 안뜨네요



보고 계신 화

스파르타 즉문즉답

면 전체를 캡처해 주

스파르타 즉문즉답

시면, 튜터님들이 빠르게 상황을 이해할 수 있어요.




작성한 코드 및 에러 메세지

source /Users/jihyeon/Desktop/sparta/pythonprac/venv/bin/activate

jihyeon@Jihyeonui-MacBookPro pythonprac % source /Users/jihyeon/Desktop/sparta/pythonprac/venv/bin/activate

(venv) jihyeon@Jihyeonui-MacBookPro pythonprac % /Users/jihyeon/Desktop/sparta/pythonprac/venv/bin/python /Users/jihyeon/Desktop/sparta/pythonprac/dbpra.py

 File "/Users/jihyeon/Desktop/sparta/pythonprac/dbpra.py", line 9

  'name':'bob',

  ^

SyntaxError: invalid syntax

(venv) jihyeon@Jihyeonui-MacBookPro pythonprac % pip install dnspython

Requirement already satisfied: dnspython in ./venv/lib/python3.8/site-packages (2.4.0)

Requirement already satisfied: httpcore>=0.17.3; python_version >= "3.8" in ./venv/lib/python3.8/site-packages (from dnspython) (0.17.3)

Requirement already satisfied: sniffio<2.0,>=1.1 in ./venv/lib/python3.8/site-packages (from dnspython) (1.3.0)

Requirement already satisfied: h11<0.15,>=0.13 in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython) (0.14.0)

Requirement already satisfied: anyio<5.0,>=3.0 in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython) (3.7.1)

Requirement already satisfied: certifi in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython) (2023.5.7)

Requirement already satisfied: idna>=2.8 in ./venv/lib/python3.8/site-packages (from anyio<5.0,>=3.0->httpcore>=0.17.3; python_version >= "3.8"->dnspython) (3.4)

Requirement already satisfied: exceptiongroup; python_version < "3.11" in ./venv/lib/python3.8/site-packages (from anyio<5.0,>=3.0->httpcore>=0.17.3; python_version >= "3.8"->dnspython) (1.1.2)

WARNING: You are using pip version 19.2.3, however version 23.2 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

(venv) jihyeon@Jihyeonui-MacBookPro pythonprac % pip install pymongo

Requirement already satisfied: pymongo in ./venv/lib/python3.8/site-packages (4.3.3)

Requirement already satisfied: dnspython<3.0.0,>=1.16.0 in ./venv/lib/python3.8/site-packages (from pymongo) (2.4.0)

Requirement already satisfied: sniffio<2.0,>=1.1 in ./venv/lib/python3.8/site-packages (from dnspython<3.0.0,>=1.16.0->pymongo) (1.3.0)

Requirement already satisfied: httpcore>=0.17.3; python_version >= "3.8" in ./venv/lib/python3.8/site-packages (from dnspython<3.0.0,>=1.16.0->pymongo) (0.17.3)

Requirement already satisfied: anyio<5.0,>=3.0 in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython<3.0.0,>=1.16.0->pymongo) (3.7.1)

Requirement already satisfied: certifi in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython<3.0.0,>=1.16.0->pymongo) (2023.5.7)

Requirement already satisfied: h11<0.15,>=0.13 in ./venv/lib/python3.8/site-packages (from httpcore>=0.17.3; python_version >= "3.8"->dnspython<3.0.0,>=1.16.0->pymongo) (0.14.0)

Requirement already satisfied: exceptiongroup; python_version < "3.11" in ./venv/lib/python3.8/site-packages (from anyio<5.0,>=3.0->httpcore>=0.17.3; python_version >= "3.8"->dnspython<3.0.0,>=1.16.0->pymongo) (1.1.2)

Requirement already satisfied: idna>=2.8 in ./venv/lib/python3.8/site-packages (from anyio<5.0,>=3.0->httpcore>=0.17.3; python_version >= "3.8"->dnspython<3.0.0,>=1.16.0->pymongo) (3.4)

WARNING: You are using pip version 19.2.3, however version 23.2 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

(venv) jihyeon@Jihyeonui-MacBookPro pythonprac % /Users/jihyeon/Desktop/sparta/pythonprac/venv/bin/python /Users/jihyeon/Desktop/sparta/pythonprac/dbpra.py

Traceback (most recent call last):

 File "/Users/jihyeon/Desktop/sparta/pythonprac/dbpra.py", line 9, in <module>

  db.users.insert_one(doc)

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 628, in insert_one

  self._insert_one(

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/collection.py", line 569, in _insert_one

  self.__database.client._retryable_write(acknowledged, _insert_command, session)

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1475, in _retryable_write

  with self._tmp_session(session) as s:

 File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/contextlib.py", line 113, in __enter__

  return next(self.gen)

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1757, in _tmp_session

  s = self._ensure_session(session)

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1740, in _ensure_session

  return self.__start_session(True, causal_consistency=False)

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/mongo_client.py", line 1685, in __start_session

  self._topology._check_implicit_session_support()

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 538, in _check_implicit_session_support

  self._check_session_support()

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 554, in _check_session_support

  self._select_servers_loop(

 File "/Users/jihyeon/Desktop/sparta/pythonprac/venv/lib/python3.8/site-packages/pymongo/topology.py", line 238, in _select_servers_loop

  raise ServerSelectionTimeoutError(

pymongo.errors.ServerSelectionTimeoutError: ac-q7dlzrb-shard-00-02.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-q7dlzrb-shard-00-00.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),ac-q7dlzrb-shard-00-01.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108), Timeout: 30s, Topology Description: <TopologyDescription id: 64b9177c6e855b58c15606a2, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('ac-q7dlzrb-shard-00-00.etq81ft.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q7dlzrb-shard-00-00.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-q7dlzrb-shard-00-01.etq81ft.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q7dlzrb-shard-00-01.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('ac-q7dlzrb-shard-00-02.etq81ft.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('ac-q7dlzrb-shard-00-02.etq81ft.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>]>

(venv) jihyeon@Jihyeonui-MacBookPro pythonprac % 



취소
 공유
취소
댓글 0
댓글 알림
나의얼굴