Windows 10 Python 3.1
我寫了一個需要大熊貓和 matplotlib 的腳本。但是,即使我已經嘗試過 cmd 中的 pip 和 Miniconda 中的 conda,我也無法安裝。
這是我在 cmd 中嘗試通過 pip 安裝時遇到的錯誤(即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):
在 conda 中,當我嘗試時conda install matplotlib,我得到了這個:
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.
我真的不確定是什么問題,因為當我在另一臺 PC 上通過類似方式安裝這些軟體包時沒有遇到這些問題,而且我確實安裝了 Python 3.1。任何幫助將不勝感激,謝謝!
uj5u.com熱心網友回復:
嘗試創建一個新環境并直接在其中安裝matplotlib和numpy,如下所示:
conda create --new env_nick python=3.8 numpy matplotlib
然后,激活環境為
conda activate env_nick
您的 python 版本很舊并且與某些更新的軟體包不兼容。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/339358.html
標籤:Python 熊猫 matplotlib 点子 蟒蛇
