How do I clone a repository so it can be imported normally in Python?

797 views Asked by At

I am looking for a way (or a folder) to clone a Git repository so after doing so, I can import it in Python like I import any other library.

Command line:

git clone newpackage.git

Python:

import newpackage

Maybe any Python related folder in my system/user variables?

1

There are 1 answers

0
Roland Smith On

Cloning the repository is not enough, you also have to actually install it.

Usually;

cd newpackage
python setup.py install

(You will probably need root/administrator provileges to install a package.)

After installation, you should be able to import the package.