AWS胶水中的小精灵与Pypark

2024-04-27 09:51:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试通过AWS Glue以PySpark作为运行时访问gremlin。由于gremlinpython是外部库,所以我下载了.whl文件并将其放入AWSS3中。现在它要求“安诺”也这样做了。然后需要isodate。所以我只是想知道,是否有任何包,我可以使用,而不是有单独的模块

下面是我最初使用所有模块测试的示例脚本,以保持简单

import boto3
import os
import sys
import site
import json
import pandas as pd
#from setuptools.command import easy_install
from importlib import reload
from io import StringIO
s3 = boto3.client('s3')
#dir_path = os.path.dirname(os.path.realpath(__file__))
#os.path.dirname(sys.modules['__main__'].__file__)

#install_path = os.environ['GLUE_INSTALLATION']
#easy_install.main( ["--install-dir", install_path, "gremlinpython"] )

#(site)

from gremlin_python import statics
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.process.strategies import *
from gremlin_python.process.traversal import T, Column
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection

所需的库如下所示,之后没有与模块相关的错误

tornado-6.0.4-cp35-cp35m-win32.whl
isodate-0.6.0-py2.py3-none-any.whl
aenum-2.2.4-py3-none-any.whl
gremlinpython-3.4.8-py2.py3-none-any.whl

Tags: 模块installpathfromimportnoneospy3