pip3を使用してdrfapikeyというモジュールをインストールしたのですが、ModuleNotFoundError
が出ています。
sudo pip3 install drfapikey
上記コマンドを実行すると、
The directory '/home/●●●/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/●●●/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
上記のメッセージが出ているのですが、インストール自体はできています。
これまでにpip3を使ってインストールしたモジュールなどは、
/home/●●●/.local/lib/python3.6/site-packages/
というディレクトリに入っているのですが、今回のインストール先を確認したところ、
/usr/local/lib/python3.6/dist-packages
というディレクトリに入っておりました。
コンソール上でpython3と打ち、インタプリタを起動すると、
import drfapikey Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'drfapikey'
となってしまいます。
PYTHONPATHが通っていない、などの原因があるようなのですが、これまでにsudo pip3 install
してきたものは問題なく使えていました。
上記のようなエラーが出る原因は何なのでしょうか?
また、どのようにすれば使えるようになるのでしょうか?
ご教示いただけますと幸いです。よろしくお願いいたします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/01/31 03:51
2019/01/31 03:55
2019/01/31 03:56
2019/01/31 04:10
2019/01/31 04:22
2019/01/31 04:28
2019/01/31 04:35
2019/01/31 04:51
2019/01/31 05:09
2019/01/31 05:42
2019/01/31 06:33
2019/01/31 06:51
2019/01/31 06:56
2019/01/31 08:54
2019/02/01 01:59
2019/02/01 08:53
2019/02/04 01:14