无法安装forexconnect Python包求助(Python 3.9.6)
解决forexconnect无法通过pip安装的问题
这个包没有发布到PyPI官方源,所以直接用pip install forexconnect会找不到匹配版本,得从GitHub源码本地安装,步骤如下:
先确保系统安装了
git和Python开发依赖:- Ubuntu:
sudo apt-get install git python3-dev python3-pip - Mac:如果没装git,先通过Xcode Command Line Tools安装
xcode-select --install,再确保pip正常可用
- Ubuntu:
克隆项目仓库到本地:
git clone https://github.com/gehtsoft/forex-connect.git进入项目目录:
cd forex-connect(建议执行)初始化并更新子模块(仓库包含子模块,不处理可能导致安装失败):
git submodule update --init --recursive执行本地安装:
python3 -m pip install .
如果安装过程中遇到编译相关错误,检查是否安装了C/C++编译工具链:
- Ubuntu:
sudo apt-get install build-essential - Mac:安装Xcode Command Line Tools后一般自带编译工具
内容的提问来源于stack exchange,提问作者usert4jju7
相关产品推荐
相关产品推荐

