Skip to main content
 首页 » 编程设计

python之无法在 Intellij IDEA 中从 requirements.txt 安装某些库

2024年12月31日31webabcd

在我用 IntellijIDEA 开发的 Python 项目中,我有文件 requirements.txt,内容如下:

paho-mqtt==1.3.1 
scipy=0.19.0 
utm==0.4.2 
pandas==0.22.0 
shapely=1.3.3 
pyproj=1.9.5.1 

当我构建项目时,出现错误:

Solving environment: ...working... failed 
 
 
PackagesNotFoundError: The following packages are not available from current channels: 
 
  - paho-mqtt==1.3.1 
 
Current channels: 
 
  - https://repo.continuum.io/pkgs/main/osx-64 
  - https://repo.continuum.io/pkgs/main/noarch 
  - https://repo.continuum.io/pkgs/free/osx-64 
  - https://repo.continuum.io/pkgs/free/noarch 
  - https://repo.continuum.io/pkgs/r/osx-64 
  - https://repo.continuum.io/pkgs/r/noarch 
  - https://repo.continuum.io/pkgs/pro/osx-64 
  - https://repo.continuum.io/pkgs/pro/noarch 

我能够在另一台笔记本电脑上毫无问题地构建这个项目。

我使用的是 Python 3.6,Python SDK 路径如下:/Users/mimi/anaconda3/bin/python。

请您参考如下方法:

当您通过 pip-install -r requirements.txt 安装时,包似乎不可用

也许你可以从 github 上 git 克隆包并安装 - https://github.com/eclipse/paho.mqtt.python#installation

或者使用 Anaconda:

conda install -c wheeler-microfluidics paho-mqtt (赢)

conda 安装-c lucaszw paho-mqtt (mac)