• 카테고리

    질문 & 답변
  • 세부 분야

    프로그래밍 언어

  • 해결 여부

    미해결

터미널 실행 시 오류

23.03.28 19:46 작성 조회수 321

0

맥북에서 터미널 실행 시 아래와 같이 오류가 나는데 어떻게 해야할까요?ㅠㅠ

Python 3.11.2 (v3.11.2:878ead1ac1, Feb  7 2023, 10:02:41) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> /Users/yeonseo/Documents/YEONSEO/02. PY/Python basic/chapter10_01.py

  File "<stdin>", line 1

    /Users/yeonseo/Documents/YEONSEO/02. PY/Python basic/chapter10_01.py

    ^

SyntaxError: invalid syntax

>>> python chapter10_01.py

  File "<stdin>", line 1

    python chapter10_01.py

           ^^^^^^^^^^^^

SyntaxError: invalid syntax

>>> python chapter10_01.py

  File "<stdin>", line 1

    python chapter10_01.py

           ^^^^^^^^^^^^

SyntaxError: invalid syntax

>>> 

 

답변 1

답변을 작성해보세요.

0

안녕하세요.

열심히 하시네요!!

맥북 모델에 따라 파이썬 2.x 버전이 설치되어 있는 경우가 있어요.

버전문제로 보입니다.(코드에 문제만 없으면요)

3.x 버전이 맞다면 python3 로 명령으로 실행해 보시구요!

가급적 vscode 등 에디터에서 현재 파이썬 버전 등을 활용하시고 실행해 보세요.