###実現したいこと
ファイルを読み込んでそれを折れ線グラフにしたい。
下記のようなエラーが出てしまいました。anacondaの問題でしょうか。
何かをインストールしなければいけないのでしょうか。
###エラー
C:\Users\usr\anaconda3\lib\site-packages\numpy\__init__.py:140: UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service from . import _distributor_init Traceback (most recent call last): File "C:\Users\usr\anaconda3\lib\site-packages\numpy\core\__init__.py", line 24, in <module> from . import multiarray File "C:\Users\usr\anaconda3\lib\site-packages\numpy\core\multiarray.py", line 14, in <module> from . import overrides File "C:\Users\usr\anaconda3\lib\site-packages\numpy\core\overrides.py", line 7, in <module> from numpy.core._multiarray_umath import ( ImportError: DLL load failed while importing _multiarray_umath: 指定されたモジュールが見つかりません。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "kadai03d.py", line 2, in <module> import matplotlib.pyplot as plt File "C:\Users\usr\anaconda3\lib\site-packages\matplotlib\__init__.py", line 139, in <module> from . import cbook, rcsetup File "C:\Users\usr\anaconda3\lib\site-packages\matplotlib\cbook\__init__.py", line 32, in <module> import numpy as np File "C:\Users\usr\anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module> from . import core File "C:\Users\usr\anaconda3\lib\site-packages\numpy\core\__init__.py", line 50, in <module> raise ImportError(msg) ImportError: IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE! Importing the numpy C-extensions failed. This error can happen for many reasons, often due to issues with your setup or how NumPy was installed. We have compiled some common reasons and troubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: * The Python version is: Python3.8 from "C:\Users\usr\anaconda3\python.exe" * The NumPy version is: "1.18.5" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: DLL load failed while importing _multiarray_umath: 指定されたモジュールが見つかりません。
###コード
python
1import matplotlib.pyplot as plt 2f=open("temperature.txt","r") 3#札幌、東京、那覇の気温をそれぞれリストにする 4sapporo_in=f.readline().split() 5tokyo_in=f.readline().split() 6naha_in=f.readline().split() 7f.close() #ファイルを閉じる 8#print("sapporo=",sapporo_in) 9#リストの各要素を数値に変換 10sapporo=[float(i) for i in sapporo_in] 11tokyo=[float(i) for i in tokyo_in] 12naha=[float(i) for i in naha_in] 13#グラフにプロットする 14month=[i for i in range(1,13)] #x座標 15plt.plot(month,sapporo,label="sapporo") 16plt.plot(month,tokyo,label="tokyo") 17plt.plot(month,naha,label="naha") 18plt.legend() #ラベルを記載する 19plt.show()
###環境
- anaconda
- Windows10
回答2件
あなたの回答
tips
プレビュー