使用PyCharm安装Python smilite失败

问题描述 投票:0回答:1

我想在我当前的 PyCharm Python 项目中安装 Python 包 smilite (https://github.com/rasbt/smilite)。我执行通常的 Python 包 -> PyPI 存储库 -> 查找“smilite” -> 安装(最新版本)。

我安装失败:

Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.


PackagesNotFoundError: The following packages are not available from current channels:

  - smilite

Current channels:

  - https://conda.anaconda.org/numba/win-64
  - https://conda.anaconda.org/numba/noarch
  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/win-64
  - https://conda.anaconda.org/bioconda/noarch
  - https://repo.anaconda.com/pkgs/main/win-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/win-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/msys2/win-64
  - https://repo.anaconda.com/pkgs/msys2/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

网站上说要使用

pip install
,但显然,PyCharm 使用的是 Conda。我不想破坏我的 PyCharm 环境;我的软件正在运行,但我需要安装它。我如何要求 PyCharm 将这个 one 包 pip install 而不是 conda install 到我当前的环境中?

我使用的是 Windows 11,PyCharm 内的 Python 解释器 (3.9) 看起来由 Conda 管理。

谢谢

python pip pycharm conda
1个回答
1
投票

进入 PyCharm 终端。 通过运行适当的命令激活您的 Conda 环境(如果尚未激活)(将名称替换为您的 conda env 名称):

conda activate your_name_of_conda_environment

激活 Conda 环境后,您可以使用 pip 安装软件包:

pip install smilite

这将使用 pip 将“smilite”包安装到您的 Conda 环境中

以这种方式使用 pip

不会影响您的 PyCharm 环境,因为您仅在激活的 Conda 环境中安装软件包。

© www.soinside.com 2019 - 2024. All rights reserved.