環境:MacOS、Blender3.0
Macにて、Pythonスクリプトを使用してBlender3.0からPythonスクリプトを実行すると
エラー内容:
ModuleNotFoundError: No module named ‘pandas_datareader’
Error: Python script failed, check the message in the system console
やったこと
ターミナルから
pip uninstall pandas_datareader
pip install pandas_datareader
pip3 install pandas_datareader
でもだめ
結論
以前使用したのはBlender2.91から、新しく3.0にした。そうなると当然Blender3.0のPythonに置き換わってしまう。
よって2.91のときにインストールしたpandas_datareaderは消去されているので、3.0用に
またインストールする必要がある。頻繁にBlenderのPython使わないから忘れている。
やったこと
自分でメモしてた
Mac版BlenderのPythonにPip、pandas_datareaderインストールしたメモ
https://pikucha.sakura.ne.jp/blog/2020/12/27/mac%E7%89%88blender%E3%81%AEpython%E3%81%ABpip%E3%80%81pandas_datareader%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%97%E3%81%9F%E3%83%A1%E3%83%A2/
MacOSのPythonとBlenderのPythonが存在する。つまりBlenderのPythonにpandas_datareaderを個別に
インストール必要がある。Pipもインストールする
以下はターミナルにて、Blenderディレクトリで実行した例である
(1)pipのインストール
1 |
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py /Applications/Blender.app/Contents/Resources/3.0/python/bin/python3.9 get-pip.py |
—
1 2 3 4 5 6 7 |
(base) ToshironoiMac:bin toshiromaseda$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py /Applications/Blender.app/Contents/Resources/3.0/python/bin/python3.9 get-pip.py % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2596k 100 2596k 0 0 5256k 0 --:--:-- --:--:-- --:--:-- 5256k curl: (3) URL using bad/illegal format or missing URL curl: (6) Could not resolve host: get-pip.py |
—
ディレクトリのファイルを確認する
get-pip.pyがあるはず。なければBlenderのバージョンディレクトリ(2.9とか3.0とか)が違うか、グーグル先生に聞く。
>あった
(base) ToshironoiMac:bin toshiromaseda$ ls
get-pip.py python3.9
(2)次にget-pip.pyを実行
1 |
/Applications/Blender.app/Contents/Resources/3.0/python/bin/python3.9 /Applications/Blender.app/Contents/Resources/3.0/python/bin/get-pip.py |
—
1 2 3 4 5 6 7 8 9 10 11 12 |
(base) ToshironoiMac:bin toshiromaseda$ /Applications/Blender.app/Contents/Resources/3.0/python/bin/python3.9 /Applications/Blender.app/Contents/Resources/3.0/python/bin/get-pip.py Collecting pip Downloading pip-22.0.4-py3-none-any.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 6.2 MB/s eta 0:00:00 Collecting wheel Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB) Installing collected packages: wheel, pip Attempting uninstall: pip Found existing installation: pip 21.2.3 Uninstalling pip-21.2.3: Successfully uninstalled pip-21.2.3 Successfully installed pip-22.0.4 wheel-0.37.1 |
—
(3)pandas_datareaderをpipでインストール
/Applications/Blender.app/Contents/Resources/3.0/python/bin/pip install pandas_datareader
—
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
(base) ToshironoiMac:bin toshiromaseda$ /Applications/Blender.app/Contents/Resources/3.0/python/bin/pip install pandas_datareader Collecting pandas_datareader Using cached pandas_datareader-0.10.0-py3-none-any.whl (109 kB) Requirement already satisfied: requests>=2.19.0 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from pandas_datareader) (2.26.0) Collecting lxml Downloading lxml-4.8.0-cp39-cp39-macosx_10_15_x86_64.whl (4.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.6/4.6 MB 8.1 MB/s eta 0:00:00 Collecting pandas>=0.23 Downloading pandas-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl (11.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.1/11.1 MB 10.7 MB/s eta 0:00:00 Collecting python-dateutil>=2.8.1 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Requirement already satisfied: numpy>=1.18.5 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from pandas>=0.23->pandas_datareader) (1.21.2) Collecting pytz>=2020.1 Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 503.5/503.5 KB 10.1 MB/s eta 0:00:00 Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from requests>=2.19.0->pandas_datareader) (1.26.7) Requirement already satisfied: certifi>=2017.4.17 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from requests>=2.19.0->pandas_datareader) (2021.10.8) Requirement already satisfied: charset_normalizer~=2.0.0 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from requests>=2.19.0->pandas_datareader) (2.0.6) Requirement already satisfied: idna<4,>=2.5 in /Applications/Blender.app/Contents/Resources/3.0/python/lib/python3.9/site-packages (from requests>=2.19.0->pandas_datareader) (3.2) Collecting six>=1.5 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Installing collected packages: pytz, six, lxml, python-dateutil, pandas, pandas_datareader Successfully installed lxml-4.8.0 pandas-1.4.2 pandas_datareader-0.10.0 python-dateutil-2.8.2 pytz-2022.1 six-1.16.0 (base) ToshironoiMac:bin toshiromaseda$ |
—