运行分支#
通过PIP安装#
pip install git+https://github.com/{user}/{repo}.git@{branch}
例如:
pip install git+https://github.com/ranaroussi/yfinance.git@feature/name
使用Git#
1: 从GitHub下载:
或者如果是特定分支:
注意
仅当您进行全局安装时才执行下一步
如果仅为某个特定项目安装,可以跳过此步骤,直接在项目目录中执行git clone
将下载位置添加到Python搜索路径
两种不同的方式,任选其一:
将路径添加到
PYTHONPATH环境变量中
2) 在Python文件顶部添加: .. code-block:: python
导入系统模块 将下载的yfinance路径添加到系统路径中
3: 验证
输出应为:
<模块 'yfinance' 来自 'path/to/downloaded/yfinance/yfinance/__init__.py'>
如果输出看起来像这样,那么你第二步做错了
<模块 'yfinance' 来自 '…/lib/python3.10/site-packages/yfinance/__init__.py'>