2

I am trying to install PyPDF2 on Anaconda via the Anaconda Navigator to be used with JupyterLab. I am faced with the following error:

(base) PS C:\Users\luke.xuereb> conda install PyPDF2 Collecting package metadata (current_repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve. Collecting package metadata (repodata.json): done Solving environment: failed with initial frozen solve. Retrying with flexible solve.

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

  • pypdf2

Current channels:

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.

I have also attempted this with a few other Python packages such as Tabula and natsorted, and both resulted in the same outcome.

I've also tried changing the environment following some research by doing the following:

conda create --name myenv
conda activate myenv

Again, this did not work. Any help would be appreciated, thanks.

Luke Xuereb
  • 73
  • 12

2 Answers2

2

Worked for me by running: conda install -c conda-forge pypdf2 as the pypdf2 package has a package in conda forge. https://anaconda.org/conda-forge/pypdf2

EDIT: Also, why didnt creating a new Environment work? If the command isnt found, you may have to add conda to your PATH envirnment variable.

Dharman
  • 30,962
  • 25
  • 85
  • 135
j-wala
  • 46
  • 1
  • 4
0

pypdf2 is now pypdf. In order to install it, use the following

conda install -c conda-forge pypdf

If that doesn't work

pip install pypdf

For more information on the package:


Notes:

  • When using Anaconda, one needs to be aware of the environment that one is working.

    Then, in Anaconda Prompt, one needs to run the following

    conda $command -n $ENVIRONMENT_NAME $IDE/package/module
    

    $command - Command that one intends to use (consult documentation for general commands)

    $ENVIRONMENT NAME - The name of one's environment (if one is working in the root, conda $command $IDE/package/module is enough)

    $IDE/package/module - The name of the IDE or package or module

  • What is the flag -c.

  • pip doesn't manage dependencies the same way conda does and can, potentially, damage one's installation.

Gonçalo Peres
  • 11,752
  • 3
  • 54
  • 83