testuser at ~]-pip3 install Request
Requirement already satisfied: Request in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (2019.3.22)
Requirement already satisfied: post in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from Request) (2019.3.22)
Requirement already satisfied: setuptools in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from Request) (40.6.2)
Requirement already satisfied: get in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from Request) (2019.3.22)
Requirement already satisfied: query-string in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from get->Request) (2019.3.22)
Requirement already satisfied: public in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from query-string->get->Request) (2019.3.22)
You are using pip version 18.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
testuser at ~]-pip install Request
Requirement already satisfied: Request in /anaconda3/lib/python3.7/site-packages (2019.3.22)
Requirement already satisfied: post in /anaconda3/lib/python3.7/site-packages (from Request) (2019.3.22)
Requirement already satisfied: setuptools in /anaconda3/lib/python3.7/site-packages (from Request) (40.8.0)
Requirement already satisfied: get in /anaconda3/lib/python3.7/site-packages (from Request) (2019.3.22)
Requirement already satisfied: query-string in /anaconda3/lib/python3.7/site-packages (from get->Request) (2019.3.22)
Requirement already satisfied: public in /anaconda3/lib/python3.7/site-packages (from query-string->get->Request) (2019.3.22)
testuser at ~]-which python
/anaconda3/bin/python
testuser at ~python3 -c "import Request" && echo $?
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'Request'
>>> print(sys.path)
['', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload', '/Users/testuser/Library/Python/3.7/lib/python/site-packages', '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages']
>>>
答え1
python
非標準の場所で使用したいようです。
設定PYTHONPATH
とPYTHONHOME
変数を使用すると、次のことがわかります。
export PYTHONPATH=/anaconda3/bin/python
export PYTHONHOME=/anaconda3/
答え2
PATH設定に関する問題が修正されました。私のsys.executableが "/Library/Frameworks/Python.framework/Versions/3.7/bin"を指して "/anaconda3/bin/python3"にリセットしました。