Search code examples
pythonpippycharmconda

Failing to install Python smilite using PyCharm


I want to install the Python package smilite (https://github.com/rasbt/smilite) within my current PyCharm Python project. I do the usual Python Packages -> PyPI repository -> look up "smilite" -> Install (latest version).

I'm getting a failed installation:

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.

The website says to use pip install, but clearly, PyCharm is using Conda. I don't want to wreck my PyCharm environment; my software is running, but I need this installed. How do I ask PyCharm to pip install rather than conda install for this one package into my current environment?

I am using Windows 11, and the Python interpreter (3.9) inside PyCharm looks to be managed by Conda.


Solution

  • Go in the PyCharm Terminal. Activate your Conda environment (if it is not already) by running the appropriate command (replace the name with your conda env name):

    conda activate your_name_of_conda_environment
    

    Once your Conda environment is activated, you can use pip to install the package:

    pip install smilite
    

    This will use pip to install the "smilite" package just into your Conda environment.

    Using pip in this way won't affect your PyCharm environment, as you're installing the package only within the activated Conda environment.