前提・実現したいこと
macでgwpyというモジュールをpip installしたいです。
発生している問題・エラーメッセージ
python
1import requests, os 2import matplotlib.pyplot as plt 3%config InlineBackend.figure_format = 'retina' 4 5try: 6 from gwpy.timeseries import TimeSeries 7except: 8 ! pip install -q gwpy 9 from gwpy.timeseries import TimeSeries
としましたところ,
python
1Traceback (most recent call last): 2 File "/usr/local/bin/pip", line 6, in <module> 3 from pkg_resources import load_entry_point 4 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module> 5 @_call_aside 6 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside 7 f(*args, **kwargs) 8 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set 9 working_set = WorkingSet._build_master() 10 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master 11 return cls._build_from_requirements(__requires__) 12 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements 13 dists = ws.resolve(reqs, Environment()) 14 File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve 15 raise DistributionNotFound(req, requirers) 16pkg_resources.DistributionNotFound: The 'pip==20.3.1' distribution was not found and is required by the application 17--------------------------------------------------------------------------- 18ModuleNotFoundError Traceback (most recent call last) 19<ipython-input-14-140a1446a3c5> in <module> 20 5 try: 21----> 6 from gwpy.timeseries import TimeSeries 22 7 except: 23 24ModuleNotFoundError: No module named 'gwpy' 25 26During handling of the above exception, another exception occurred: 27 28ModuleNotFoundError Traceback (most recent call last) 29<ipython-input-14-140a1446a3c5> in <module> 30 7 except: 31 8 get_ipython().system(' pip install -q gwpy') 32----> 9 from gwpy.timeseries import TimeSeries 33 34ModuleNotFoundError: No module named 'gwpy'
というエラーが出てしまいます。
https://github.com/pypa/pip/issues/6399
の方法でpipを入れ直してみたりしましたが同様のエラーが変わらず出ました。
pip installについての知識が浅いため,他にどうすれば良いのか分かりません。
よろしくお願いいたします。
###補足
ちなみに単純にmacのターミナルで
$pip install gwpy
を行うと,
Traceback (most recent call last): File "/usr/local/bin/pip", line 6, in <module> from pkg_resources import load_entry_point File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3241, in <module> @_call_aside File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3225, in _call_aside f(*args, **kwargs) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 3254, in _initialize_master_working_set working_set = WorkingSet._build_master() File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 585, in _build_master return cls._build_from_requirements(__requires__) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 598, in _build_from_requirements dists = ws.resolve(reqs, Environment()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 786, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'pip==20.3.1' distribution was not found and is required by the application
となりました。
###環境
Catalina 10.15.7
VS code
Python 3.7.3 64-bit('base':conda)
~/anaconda3/bin/python に変更しました
回答1件
あなたの回答
tips
プレビュー