Home > Mobile >  Why can't I install matplotlib or pandas with pip OR miniconda?
Why can't I install matplotlib or pandas with pip OR miniconda?

Time:10-28

Windows 10 Python 3.1

I have a script written that requires pandas and matplotlib. However, I'm having trouble installing either even though I've tried both pip in cmd and conda in Miniconda.

Here's the error I get when trying to install either via pip in cmd (ie py -m pip install -U matplotlib:

ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Nick\miniconda3\envs\name_of_my_env\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Nick\\AppData\\Local\\Temp\\pip-install-jlytfo2_\\matplotlib_5bffd16903a8431f98af43098502973c\\setup.py'"'"'; __file__='"'"'C:\\Users\\Nick\\AppData\\Local\\Temp\\pip-install-jlytfo2_\\matplotlib_5bffd16903a8431f98af43098502973c\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Nick\AppData\Local\Temp\pip-wheel-3tmzcurv'
       cwd: C:\Users\Nick\AppData\Local\Temp\pip-install-jlytfo2_\matplotlib_5bffd16903a8431f98af43098502973c\
  Complete output (551 lines):

In conda, when I try conda install matplotlib, I get this:

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:

  - python=3.1

Current channels:

  - https://conda.anaconda.org/conda-forge/win-64
  - https://conda.anaconda.org/conda-forge/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.

I'm really not sure what could be wrong since I didn't run into these problems when I installed these packages through similar means on my other PC, and I definitely do have Python 3.1 installed. Any help would be appreciated, thanks!

CodePudding user response:

Try creating a new environment and installing matplotlib and numpy in it directly as follows:

conda create --new env_nick python=3.8 numpy matplotlib

Then, activate the environment as

conda activate env_nick

Your python version is old and incompatible with some of the updated packages.

  • Related