pip installしたはずなのにImport errorを解決する方法
2012 ワード
$ pip install tweepy --user
Requirement already satisfied: tweepy in /home/ubuntu/.local/lib/python3.7/site-packages (3.8.0)
Requirement already satisfied: six>=1.10.0 in /usr/lib/python3/dist-packages (from tweepy) (1.11.0)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /home/ubuntu/.local/lib/python3.7/site-packages (from tweepy) (1.3.0)
Requirement already satisfied: PySocks>=1.5.7 in /home/ubuntu/.local/lib/python3.7/site-packages (from tweepy) (1.7.1)
Requirement already satisfied: requests>=2.11.1 in /usr/lib/python3/dist-packages (from tweepy) (2.18.4)
Requirement already satisfied: oauthlib>=3.0.0 in /home/ubuntu/.local/lib/python3.7/site-packages (from requests-oauthlib>=0.7.0->tweepy) (3.1.0)
してるのに
$ python3 followback_unfollow.py
Traceback (most recent call last):
File "followback_unfollow.py", line 3, in <module>
import tweepy
ModuleNotFoundError: No module named 'tweepy'
ubuntu@ip-192-168-1-89:~/my-app$
解決するには
$ export PYTHONPATH=$PYTHONPATH:/home/ubuntu/.local/lib/python3.7/site-packages
して
$ source ~/.bashrc
する。
$ python3 followback_unfollow.py
Works!!!
参考
pip installしたはずなのにImport errorと言われた場合
pipでインストールしたパッケージの場所を調べる
Author And Source
この問題について(pip installしたはずなのにImport errorを解決する方法), 我々は、より多くの情報をここで見つけました https://qiita.com/rh_/items/a2994474b86a9944643c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .