機械学習目的でpythonを始めたばかりの初心者の質問です。
ターミナルで下記を実行するとエラーになっており解決ができません。
バージョンなどの問題の気がするのですが、どの部分を修正すればいいのかご意見をいただけませんでしょうか。
python matplotlib.py Traceback (most recent call last): File "matplotlib.py", line 2, in <module> import matplotlib.pyplot as plt File "/Users/user/projects/python/matplotlib.py", line 2, in <module> import matplotlib.pyplot as plt ImportError: No module named 'matplotlib.pyplot'; 'matplotlib' is not a package
matplotlib.py
import numpy as np import matplotlib.pyplot as plt flip=1 x = np.linspace(0, 14, 100) for i in range(1, 7): plt.plot(x, np.sin(x + i * .5) * (7 - i) * flip) plt.show()
pythonを入れた方法
anyenvでpyenvを入れて3.5.1をインストールした。
pip install matplotlibは入ってるのですが実際にpythonを実行するとエラーになる現象にみまわれております。
pip install matplotlib Requirement already satisfied (use --upgrade to upgrade): matplotlib in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.0,!=2.0.4,>=1.5.6 in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): cycler in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): pytz in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from matplotlib) Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in /Users/user/.anyenv/envs/pyenv/versions/3.5.1/lib/python3.5/site-packages (from python-dateutil->matplotlib)

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/05/02 02:49