2

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!

eyllanesc
  • 235,170
  • 19
  • 170
  • 241

2 Answers2

5

Conda 4.10 is incompatible with python 3.10.

You basically cannot install anything after creating and activating your python 3.10 environment. You cannot even install conda-build:

conda install conda-build -y
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

ResolvePackageNotFound:
  - python=3.1

Conda 4.10 contains python 3.9 and conda 4.11 contains python 3.10, so your base environment should be compatible with the python version therein.

If you need python 3.10+

If you need python 3.10 or newer, you must have conda 4.11 or newer. Install the desired conda version, or switch to the base environment and update conda using conda update conda.

If you want to keep the old conda

Install another environment with python 3.9 or older like conda create --name py39 python=3.9 and activate it.

DanielTuzes
  • 2,494
  • 24
  • 40
2

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.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
MNK
  • 634
  • 4
  • 18
  • This worked! I have no idea why my environment(s) was operating in an older version of Python. I'll also note that since I use VS Code, I had to change the environment I was using to the one I created with this method, and am good to go now. – Nick Seymour Oct 27 '21 at 14:51