【问题标题】:Cannot install some libraries from requirements.txt in IntellijIDEA无法从 Intellij IDEA 中的 requirements.txt 安装一些库
【发布时间】:2018-07-19 13:05:12
【问题描述】:

在我用 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

【问题讨论】:

    标签: python python-3.x intellij-idea anaconda python-3.6


    【解决方案1】:

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

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

    或者使用 Anaconda:

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

    conda install -c lucaszw paho-mqtt (mac)

    【讨论】:

    • 因为我有Mac,所以我测试了conda install -c lucaszw paho-mqtt。但我收到此错误:UnsatisfiableError: The following specifications were found to be in conflict: - paho-mqtt - traitlets Use "conda info <package>" to see the dependencies for each package.
    • 我将系统解释器更改为另一个版本的 Python,现在 requirements.txt 中提到的所有库都已正确安装。
    • 能否在(anaconda)环境中打开终端并输入下一个:
    • git clone github.com/eclipse/paho.mqtt.python.git, cd paho.mqtt.python, python setup.py install (如果你使用的是 Python 3.X 这应该可以)。在 python 2.7 conda install -c lucaszw paho-mqtt 应该没问题
    猜你喜欢
    • 2021-04-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-16
    • 1970-01-01
    • 2022-11-28
    相关资源
    最近更新 更多