python github 优秀库,从Github导入Python库

I'm new to Python so this may sound silly.

I want to use a Python library I've found on Github, lets say on https://github.com/praw-dev/praw, and I want to be able to do git pull in the future to pull the latest commits.

Question: Should I git clone in the project directory and delete everything except the praw directory, then in my python script do a import praw?

In iPython,

import praw

gives the error ImportError: No module named praw

Directory Structure

~\myProject\

praw\

myNotebook.ipynb

解决方案

Actually, if given package is not on PyPI (or you want a specific branch) you can still install it through pip from GitHub with:

pip install git+https://github.com/[repo owner]/[repo]@[branch name]

And for your problem it would be (although @pandita's answer is correct for normal usage case):

pip install git+https://github.com/praw-dev/praw.git

For more information check this answer.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值