虽然,我已经安装了 python-jose,但它仍然抱怨运行“chalice local”时找不到 jose 模块。任何人都可以帮忙。
Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/chalice/cli/__init__.py", line 357, in main
return cli(obj={})
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 716, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 696, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 1060, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 889, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/dist-packages/click/core.py", line 534, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/chalice/cli/__init__.py", line 134, in deploy
api_gateway_stage=api_gateway_stage,
File "/usr/local/lib/python3.6/dist-packages/chalice/cli/factory.py", line 122, in create_config_obj
app_obj = self.load_chalice_app()
File "/usr/local/lib/python3.6/dist-packages/chalice/cli/factory.py", line 180, in load_chalice_app
app = importlib.import_module('app')
File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/sudip/myproj/app.py", line 2, in <module>
from chalicelib.common import get_cors_congiguration as get_cors_config
File "/home/sudip/abc/dorm.py", line 15, in <module>
from jose import jwk, jwt as jjwt
ModuleNotFoundError: No module named 'jose'
但是,当我运行 python3.6 控制台然后导入 jose 时,它不会抱怨。任何想法?
python3.6
Python 3.6.5 (default, Mar 29 2018, 03:28:50)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import jose
>>>