How to solve syntax error with git clone code? - python-3.x

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.

Related

sudo/apt-get command not found in git bash

I am using Windows 10 in my machine, and currently installed git bash on it.
I wanted to install node and npm for my application.
when i tried :
apt-get install nodejs
"apt-get" command not found,
I tried google and got
sudo install nodejs
"sudo" command not found.
How to use sudo and apt-get command on my git bash.
Git for Windows comes with a Windows port of Bash and a collection of few more common *nix command-line tools that have been compiled for Windows, it does not provide a complete *nix environment. Hence you cannot use tools like sudo and apt-get which modify the *nix operating system.
However, there are other tools, programs if you like, available.
Try to install node " the windows way ".
win-sudo package adds sudo to windows.
kafaior at Super User suggests:
A working sudo replacement for Cygwin's mintty terminal would be to place the following script in user's PATH:
$!/bin/bash
cygstart --action=runas mintty -e `which bash` -lc \"$#\"
Maximus mentions how to add sudo (well, csudo) via cmder.
Super User has a similar question here.
It looks like there is a command runas or elevate commands. These might be for PowerShell, rather than git bash. I'm not sure.
I found your this while looking for a way to add rsync to Git Bash. So below I included info that may or may not work for sudo or apt-get. If they do not work directly for specific commands the OP is asking about, they may inspire a solution that does work. Also this could help others who arrived here as I did.
rsync is another unix command not available in the standard installation of git bash.
However, you can download and install the Git for Windows SDK (scroll to the bottom of the page for the link). This will allow you to create a version of the Git for Windows installer that does include additional *nx commands.
Install the Git for Windows SDK according to the instructions. Part 2 is where you add the packages you want, that aren't included in the standard git bash installation. Part 3 is where you create a Git installer, which will include the additional packages. If you skipped step 2, this should produce an installer similar to the standard installer.. There is a good discussion as to why they cannot include these commands in the general distribution.
It is also possible to just grab rsync filehere or here and unpack it directly within your Git installation, and it works. I dunno if it is also possible to do something similar for sudo or apt-get.
Finally, it looks like there is a way to get *nix commands available within the Git Bash shell via cmder. Here are the instructions.
Installing applications in git bash does not sound right to me. I would suggest you either use the native Windows installer (https://nodejs.org/) or, if you prefer a package manager, use Chocolatey (https://chocolatey.org/) to install nodejs with:
choco install nodejs

install atom on centos 7 without admin privileges

If it is possible could someone show me how to get the editor Atom working on CentOS Linux release 7.x. I'm working on a computing cluster so I don't have sudo privileges. The instructions here: https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md
seem to require sudo privileges
How do I install it with these constraints?
In the link that you have shared, go to the Instructions section below openSuse instructions.
Step 1 is:
git clone https://github.com/atom/atom
cd atom
Run this step in your home directory.
After that run Step 2 and Step 3 as per the document:
git fetch -p
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
script/build
After that instead of Step 4, run:
script/grunt install --install-dir /home/<your-username>/bin/
This will install the application in your home directory which can be done without sudo privilege. You can add /home/<your-username>/bin at the end of your PATH variable and you should be able to use atom as usual.
All this is assuming that you have the requirements for atom already installed on the system, particularly node.js. If not, you will have to install node.js as well as per https://www.vultr.com/docs/installing-node-js-from-source-on-ubuntu-14-04
In this, instead of ./configure, run ./configure --prefix=/home/<your-username>

No manual entry for giteveryday

I installed git using
_sudo apt-get install git_
But git help everyday gives following error:
No manual entry for giteveryday
Even though, this appears similar to one How do I get git manual entries?
I feel this is different.
git-man is already installed and git help <command> works for all commands except giteveryday.
I don't know why this is happening?? Am I missing something??
Since you have downloaded git from a source and ended up not having the git manpages.
You can download those and then try your command :
sudo apt-get install git-man
Manual download source is here.
Edit : As suggested by #ElpieKay in Ubuntu the same command goes as :
sudo apt-get install git-doc
If Git is installed, you can always run git --html-path to see where the html docs are. You can find the link to giteveryday in the index.html.
Also you can read it online.

Buildozer initiation issue in Ubuntu as 'command not found'

I am trying to convert a kivy .py file into .apk using buildozer in ubuntu. I have been following this person's tutorial:
https://kivyspacegame.wordpress.com/2014/06/30/tutorial-how-to-build-python-for-android-with-ubuntu-and-buildozer/
However, I am stuck at the stage at
buildozer init
Resulting in error.
command not found
Similar issue is seen here https://groups.google.com/forum/#!topic/kivy-users/_uCnOC8fdPo. But it doesn't have a solution. I checked cython and buildozer installations using 'pip freeze" and going into python and type 'import cython' and 'import buildozer', they didn't give me any error message.
it is already an older thread but, try this, if you have the problem today either. Just simply tiping this in the terminal..
git clone https://github.com/kivy/buildozer
cd buildozer
python setup.py build
sudo pip install -e .
and now u can type->
buildozer init
etc..
p.s.
sorry for my English :D <3
These are the steps I tried to get out of it.
First uninstall buildozer :
pip3 uninstall buildozer
Then clone buildozer git :
git clone <link>https://github.com/kivy/buildozer.git</link>
cd git_directory_new_made
Now in terminal go to root :
sudo su
enter password:your password here
python3 setup.py install
Go out of terminal and then reopen it.

Installing Node.JS on Mac

I'm trying to install Node.JS on Mac OSX 10.9.3 by following the steps on this website.
When I type the following command:
git clone git://github.com/ry/node.git
I am getting the following error:
fatal: destination path 'node' already exists and is not an empty directory.
How do I resolve this?
It means there's already a folder called "node" in your current folder. Either delete it, or move to another folder and try again.
As a side comment, try installing Node (and any other software) using a package manager like Homebrew or MacPorts, for easier installation/uninstallation experience.
Install Node.js on Mac zsh
Using Homebrew:
brew install node
If you want to download the package with bash:
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

Resources