问题描述
我目前正在尝试将 Lambda 作为 Zappa (Python3.6) 启动.在 AWS 端部署应用程序/配置完所有内容后,我运行以下命令在本地环境中测试应用程序,
I'm currently trying to launch a Lambda as a Zappa (Python3.6). After deploying the app / configuring everything on the AWS-side, I ran the following command to test the app in my local environment,
zappa 调用生产 script.main
并得到这个错误,
/tmp/virtualenv_name/pymssql.cpython-36m-x86_64-linux-gnu.so:未定义符号:PyFPE_jbuf:ImportError
回溯(最近一次调用最后一次):文件/var/task/handler.py",第 509 行,在 lambda_handler 中返回 LambdaHandler.lambda_handler(event, context)
Traceback (most recent call last): File "/var/task/handler.py", line 509, in lambda_handler return LambdaHandler.lambda_handler(event, context)
文件/var/task/handler.py",第 237 行,在 lambda_handler 中handler = cls()
File "/var/task/handler.py", line 237, in lambda_handler handler = cls()
文件/var/task/handler.py",第 129 行,initself.app_module = importlib.import_module(self.settings.APP_MODULE)
File "/var/task/handler.py", line 129, in init self.app_module = importlib.import_module(self.settings.APP_MODULE)
文件/var/lang/lib/python3.6/importlib/init.py",第 126 行,在 >import_module 中return _bootstrap._gcd_import(name[level:], package, level)
File "/var/lang/lib/python3.6/importlib/init.py", line 126, in >import_module return _bootstrap._gcd_import(name[level:], package, level)
文件frozen importlib._bootstrap",第 978 行,在 _gcd_import 中
File "frozen importlib._bootstrap", line 978, in _gcd_import
文件frozen importlib._bootstrap",第 961 行,在 _find_and_load 中
File "frozen importlib._bootstrap", line 961, in _find_and_load
文件frozen importlib._bootstrap",第 950 行,在 _find_and_load_unlocked 中
File "frozen importlib._bootstrap", line 950, in _find_and_load_unlocked
文件frozen importlib._bootstrap",第 655 行,在 _load_unlocked 中
File "frozen importlib._bootstrap", line 655, in _load_unlocked
文件frozen importlib._bootstrap_external>",第 678 行,在 exec_module 中
File "frozen importlib._bootstrap_external>", line 678, in exec_module
文件frozen importlib._bootstrap",第 205 行,在 _call_with_frames_removed 中
File "frozen importlib._bootstrap", line 205, in _call_with_frames_removed
文件/tmp/virtualenv_name/script.py",第 3 行,在 > 模块中
File "/tmp/virtualenv_name/script.py", line 3, in > module
导入pymssql
导入错误:/tmp/virtualenv_name/pymssql.cpython-36m-x86_64-linux-gnu.so:未定义符号:PyFPE_jbuf
ImportError: /tmp/virtualenv_name/pymssql.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyFPE_jbuf
我读过的关于 PyFPE_jbuf
的大多数问题似乎都涉及某个依赖项的多次安装,但似乎没有任何解决方案适用于此.到目前为止,我已经尝试过,
Most of the issues with PyFPE_jbuf
that I've read about seem to involve multiple installations of a certain dependency, but none of the solutions seem to apply here. So far I've tried,
- 在我的虚拟环境中卸载并重新安装 pymssql,并运行
zappa update
. - 卸载并重新安装其他包含 pymssql 的包/库(如 sqlalchemy),并运行
zappa update
. - 取消部署项目,执行 1 和 2,然后重新部署它.
在我的虚拟环境中卸载并重新安装 cython,并运行
zappa update
.
我对这个错误的理解正确吗?任何故障排除建议?修复了吗?
Is my understanding of this error correct? Any suggestions for troubleshooting? Fixes?
谢谢!
推荐答案
我在 anaconda 环境中尝试安装 dragnet
和 spacy
时遇到了类似的问题.我相信 pip install
使用的是使用另一个 gcc
版本编译的缓存文件.解决我的问题的是卸载库,然后使用 --no-cache-dir
标志重新安装它,例如.pip install dragnet --no-cache-dir
通过为新环境运行 setup.py
从头开始构建包.
I faced a similar problem while trying to install dragnet
and spacy
in an anaconda environment. I believe pip install
was using a cached file that was compiled using another gcc
version. What solved my problem was uninstalling the library and then reinstalling it using the --no-cache-dir
flag, ex. pip install dragnet --no-cache-dir
which built the package from scratch by running the setup.py
for the new environment.
另请注意,您可能需要运行 sudo apt install libxml2-dev libxslt-dev python-dev
才能成功构建(至少对于 dragnet
和 spacy
,但你可能需要别的东西)
Also note that you might need to run sudo apt install libxml2-dev libxslt-dev python-dev
for the build to be successful (at least for dragnet
and spacy
, but you might need something else)
这篇关于“导入错误"/“未定义符号:PyFPE_jbuf";使用 pymssql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!