求助:在PyCharm的Conda环境中用pip安装smilite的方法
在Conda管理的Python环境中用pip安装smilite包的方法
问题背景
在Windows11系统的PyCharm中,使用Conda管理的Python3.9环境,通过Python Packages面板搜索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安装,现需在不破坏当前Conda环境的前提下完成安装。
解决方法
方法一:PyCharm图形界面操作
- 打开PyCharm右侧边栏的
Python Packages面板 - 确认面板顶部的
Python Interpreter已选中目标Conda环境(Python3.9) - 在搜索框输入
smilite,找到对应包后,点击包右侧的下拉箭头,选择Install with pip选项,等待安装完成即可。
方法二:终端命令操作
- 打开PyCharm底部的
Terminal终端 - 若终端未自动激活目标Conda环境,执行激活命令:
(注:若使用base环境,可跳过此步骤)conda activate 你的环境名称 - 执行pip安装命令:
若需要安装GitHub上的最新版本,可执行:pip install smilitepip install git+https://github.com/rasbt/smilite.git
验证安装
执行pip list命令,若输出中包含smilite,说明安装成功;也可回到PyCharm的Python Packages面板搜索确认。
内容的提问来源于stack exchange,提问作者Anthony Nash
相关产品推荐
相关产品推荐

