Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 在azure函数v2-python中使用shapely库_Python 3.x_Azure Functions - Fatal编程技术网

Python 3.x 在azure函数v2-python中使用shapely库

Python 3.x 在azure函数v2-python中使用shapely库,python-3.x,azure-functions,Python 3.x,Azure Functions,正在尝试从VS代码运行python azure函数。使用requirements.txt导入必要的LIB。当尝试安装Shapely==1.6.4.post2时,我收到错误消息,请参见下面的内容 我已经尝试过的:在本地运行python函数而不使用 azure函数 并使用了清晰的python环境-效果良好 import datetime import logging from shapely.geometry import shape, Point, Polygon import azure.fu

正在尝试从VS代码运行python azure函数。使用requirements.txt导入必要的LIB。当尝试安装Shapely==1.6.4.post2时,我收到错误消息,请参见下面的内容

我已经尝试过的:在本地运行python函数而不使用 azure函数 并使用了清晰的python环境-效果良好

import datetime
import logging
from shapely.geometry import shape, Point, Polygon

import azure.functions as func

def main(mytimer: func.TimerRequest) -> None:
    utc_timestamp = datetime.datetime.utcnow().replace(
        tzinfo=datetime.timezone.utc).isoformat()

    if mytimer.past_due:
        logging.info('The timer is past due!')

    logging.info('Python timer trigger function ran at %s', utc_timestamp)

>正在PythonAzureFunctions文件夹中执行任务:.env\Scripts\python-m pip install-r requirements.txt<
已满足要求:e:\onedrive abb\onedrive-abb\work\pythonazurefunctions\.env\lib\site软件包(来自-r requirements.txt(第1行))中的pip==19.1.1(19.1.1)
收集Shapely==1.6.4.post2(来自-r requirements.txt(第2行))
使用缓存https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
错误:命令python setup.py egg_info的完整输出:
错误:回溯(最近一次呼叫上次):
文件“”,第1行,在
文件“C:\Users\T\AppData\Local\Temp\pip install-\u xq0ijpu\Shapely\setup.py”,第80行,在
从shapely.\u buildcfg导入geos\u版本\u字符串,geos\u版本\
文件“C:\Users\T\AppData\Local\Temp\pip install-\u xq0ijpu\Shapely\Shapely\\u buildcfg.py”,第200行,在
lgeos=CDLL(“geos_c.dll”)
文件“C:\Program Files(x86)\Microsoft Visual Studio\Shared\Python36\u 64\lib\ctypes\\uuuuuu init\uuuuu.py”,第348行,在\uuu init中__
self.\u handle=\u dlopen(self.\u名称,模式)
OSError:[WinError 126]找不到指定的模块
----------------------------------------
错误:命令“python setup.py egg\u info”在C:\Users\T\AppData\Local\Temp\pip install-\uxq0ijpu\Shapely中失败,错误代码为1\
终端进程终止,退出代码为:1
终端将被任务重用,请按任意键将其关闭。

Shapely需要单独安装到python环境中

手动从以下位置下载文件:

然后使用: pip安装Shapely 1.6.4.post1 cp35 cp35m win_amd64.whl


Shapely需要单独安装到python环境中

手动从以下位置下载文件:

然后使用: pip安装Shapely 1.6.4.post1 cp35 cp35m win_amd64.whl

Content of requirements.txt:
pip==19.1.1
Shapely==1.6.4.post2

> Executing task in folder PythonAzureFunctions: .env\Scripts\python -m pip install -r requirements.txt <

Requirement already satisfied: pip==19.1.1 in e:\onedrive-abb\onedrive - abb\work\pythonazurefunctions\.env\lib\site-packages (from -r requirements.txt (line 1)) (19.1.1)
Collecting Shapely==1.6.4.post2 (from -r requirements.txt (line 2))
  Using cached https://files.pythonhosted.org/packages/a2/fb/7a7af9ef7a35d16fa23b127abee272cfc483ca89029b73e92e93cdf36e6b/Shapely-1.6.4.post2.tar.gz
    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\T\AppData\Local\Temp\pip-install-_xq0ijpu\Shapely\setup.py", line 80, in <module>
        from shapely._buildcfg import geos_version_string, geos_version, \
      File "C:\Users\T\AppData\Local\Temp\pip-install-_xq0ijpu\Shapely\shapely\_buildcfg.py", line 200, in <module>
        lgeos = CDLL("geos_c.dll")
      File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\ctypes\__init__.py", line 348, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: [WinError 126] The specified module could not be found
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\T\AppData\Local\Temp\pip-install-_xq0ijpu\Shapely\
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.