はじめに
私の記事では毎度お馴染みの自作競艇予想サイト、「きょう、ていの良い
予想はあたるだろうか。」に自然言語処理的な機能を追加しました。
本記事では、PythonAnywhereにていざ実装!となった段階で起きたトラブルをまとめています。
Localでは動くが、PythonAnywhere上で動かない!!
Local環境での動作検証を終え、万を辞してPythonAnywhere上のファイルを差し替え、更新!!しかし、ここでエラーが起こりました..
errorlogを確認すると、どうやらjanomeがinstallされていないことが原因の様でした...
意外と簡単だったpip install
PythonAnywhere上の環境にも「pip install janome」的なことを実施すればいいので、その方法を探した所、あっけなく見つかりました。
以下、その手順となります。
①Consoleタブに移動し、Bash consoleをクリック
②開かれたら、pip install --user janomeと打ち込む
他のmoduleをinstallしたい場合も同様ですね。
(下図はすでにinstallした後のものです..)
③"pip list"と打ち込んで入力されていることを確認!
おわりに
無事、PythonAnywhere上でも動作できるようになりました!!めでたしめでたし。janomeをinstallして何をしたのかは、私の別記事を読んでいただければ幸いです..。
公式サイトにも解説が載っていましたので、こちらもご参考に。