简体   繁体   English

Numpy 在 Python3 Google App Flexible Engine 中失败

[英]Numpy failing in Python3 Google App Flexible Engine

I'm running Python3 in App Engine (Fleixble) and am receiving the following error:我在 App Engine (Fleixble) 中运行 Python3 并收到以下错误:

ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes 
all files not under version control).  Otherwise reinstall numpy.

I uploaded the numpy library "pip3 install -t /lib numpy" and have it in my requirements file (not sure if this is correct).我上传了 numpy 库“pip3 install -t /lib numpy”并将它放在我的需求文件中(不确定这是否正确)。

Requirements.txt:要求.txt:

Flask==1.0.2
gunicorn==19.7.1
numpy==1.15.4

I've re-installed numpy a few times and receive this log:我已经重新安装了 numpy 几次并收到此日志:

Collecting numpy
Using cached
https://files.pythonhosted.org/packages/74/68/2b00ba3c7390354db2a1706291750b6b7e911f6f79c0bd2184ae04f3c6fd/numpy-1.15.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
quandl 3.2.0 has requirement requests<2.18,>=2.7.0, but you'll have 
requests 2.19.1 which is incompatible.
Installing collected packages: numpy
Successfully installed numpy-1.15.4

Any help would be greatly appreciated:)任何帮助将不胜感激:)

EDIT:编辑:

I've come across this - https://github.com/numpy/numpy/issues/9272我遇到过这个 - https://github.com/numpy/numpy/issues/9272

However it appears this seems to affect Python 3.6.0 whereas the Python runtime interpreter is 3.6.4 (as specified by '3') in the app.yaml file.然而,这似乎影响了 Python 3.6.0,而app.yaml文件中的 Python 运行时解释器是 3.6.4(由“3”指定)。 More information about Google's Python configuration here -https://cloud.google.com/appengine/docs/flexible/python/runtime有关 Google 的 Python 配置的更多信息,请参见此处 -https://cloud.google.com/appengine/docs/flexible/python/runtime

The issue is that you're installing the built distribution ("wheel") for macOS, but the environment that you're attempting to use the dependency in is not macOS.问题是您正在为 macOS 安装内置发行版(“wheel”),但您尝试在其中使用依赖项的环境不是 macOS。 You can tell this based on the filename:您可以根据文件名判断:

numpy-1.15.4-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

You'll want to explicitly specify the platform/ABI/implementation options to those which the Flex environment requires:您需要明确指定 Flex 环境所需的平台/ABI/实现选项:

$ pip install \
    --target lib \
    --python-version 36 \
    --platform manylinux1_x86_64 \
    --abi cp36m \
    --implementation cp \
    --only-binary=:all:
    numpy

Make sure to do this from a clean lib directory, and with the latest version of pip .确保从干净的lib目录并使用最新版本的pip执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Google App Engine for Python3 上安装库 - How to install libraries on Google App Engine for Python3 如何将 Google App Engine 从 Python2.7 和 DataStore 迁移到 Python3 - How to migrate Google App Engine from Python2.7 and DataStore to Python3 App Engine Flexible 和 CloudSQL 之间的 Google VPC 内的流量是否加密 - Is traffic encrypted inside Google VPC between App Engine Flexible and CloudSQL python3 使用 google-app-engine 接收 email,如何配置到特定应用程序,而不是默认应用程序 - python3 use google-app-engine receive email, how to configure to specific app, not default app python3 使用谷歌应用引擎接收 email,而不是如何正确获取日期和大小 - python3 use google app engine to receive email, than how to get date and size properly 如何在 Google App Engine 柔性环境中设置 jetty 线程池 - how to set the jetty thread pool in Google App Engine flexible environment Google App Engine Flexible env 的定价,一节 500 美元的课程 - Pricing of Google App Engine Flexible env, a $500 lesson 无法在 Google App Engine 上部署 Course Builder - Failing to deploy a Course Builder on Google App Engine Google App Engine 如何从灵活环境转变为标准环境 - How do change from Google App Engine from Flexible Environment to Standard environment 从 Python 2 升级到 Python 3 Google App Engine - Upgrading from Python 2 to Python 3 Google App Engine
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM