简体   繁体   中英

How to solve syntax error with git clone code?

I'm python beginner and have issues with running a the following command:

git clone https://github.com/marksgraham/OCT-Converter.git

( https://github.com/marksgraham/OCT-Converter )

I have installed Python 3.7.4 on my mac and tied to run this in the IDLE. But it says "SyntaxError: invalid syntax" regarding "clone". Do I need to install something else first to be able to run this?

you just need to '!' before the command

Your command would be like,

!git clone https://github.com/marksgraham/OCT-Converter.git

NOTE: if you are using anaconda navigator or googlecolab

It's because you can't use git clone in IDLE.
To clone a git repository you should open a terminal and go the location in which you want to clone the repo, and then type the following command:
git clone https://github.com/marksgraham/OCT-Converter.git
If it still give you an error then you need to install git, for Mac you can use this installer .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM