簡體   English   中英

Google Cloud Dataflow(Python)-無法正確安裝依賴項

[英]Google Cloud Dataflow (Python) - Not installing dependencies correctly

我正在嘗試在此處運行官方數據流示例: https : //github.com/GoogleCloudPlatform/dataflow-prediction-example

但是,由於日志中存在以下類型的錯誤,Dataflow作業無法正確啟動(並且其他作業也發生了相同的錯誤):

    (happens 2nd) Could not install packages due to an EnvironmentError: 
    [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/tensorflow-1.9.0.dist-info/METADATA' 
    (happens 1st) Successfully built tensorflow-module 

我完全按照Github上的指示進行操作,這是此示例的virtualenv pip freeze的輸出:

    absl-py==0.4.0
    apache-beam==2.6.0
    astor==0.7.1
    avro==1.8.2
    backports.weakref==1.0.post1
    cachetools==2.1.0
    certifi==2018.8.13
    chardet==3.0.4
    crcmod==1.7
    dill==0.2.8.2
    docopt==0.6.2
    enum34==1.1.6
    fasteners==0.14.1
    funcsigs==1.0.2
    future==0.16.0
    futures==3.2.0
    gapic-google-cloud-pubsub-v1==0.15.4
    gast==0.2.0
    google-apitools==0.5.20
    google-auth==1.5.1
    google-auth-httplib2==0.0.3
    google-cloud-bigquery==0.25.0
    google-cloud-core==0.25.0
    google-cloud-pubsub==0.26.0
    google-gax==0.15.16
    googleapis-common-protos==1.5.3
    googledatastore==7.0.1
    grpc-google-iam-v1==0.11.4
    grpcio==1.14.1
    hdfs==2.1.0
    httplib2==0.11.3
    idna==2.7
    Markdown==2.6.11
    mock==2.0.0
    monotonic==1.5
    numpy==1.14.5
    oauth2client==4.1.2
    pbr==4.2.0
    ply==3.8
    proto-google-cloud-datastore-v1==0.90.4
    proto-google-cloud-pubsub-v1==0.15.4
    protobuf==3.6.1
    pyasn1==0.4.4
    pyasn1-modules==0.2.2
    pydot==1.2.4
    pyparsing==2.2.0
    pytz==2018.4
    PyVCF==0.6.8
    PyYAML==3.13
    requests==2.19.1
    rsa==3.4.2
    six==1.11.0
    tensorboard==1.10.0
    tensorflow==1.10.0
    termcolor==1.1.0
    typing==3.6.4
    urllib3==1.23
    Werkzeug==0.14.1

這個pip依賴問題發生在我嘗試過的所有其他工作上,所以我決定嘗試使用正式的github示例,這也正在發生。

該工作ID是: 2018-08-15_23_42_57-394561747688459326 ,我正在使用Python 2.7

感謝您的幫助,以及任何指導!

如Apache Beam文檔中有關如何處理管道中的Python依賴項中所述 ,對PyPI依賴項的推薦方法是創建一個requirements.txt文件,然后將其作為可選的命令行選項傳遞,如下所示(可能是實驗這個問題時出錯):

--requirements_file requirements.txt

無論如何,正如我在有關如何使用TensorFlow運行Apache Beam的最新示例中所看到的那樣, 代碼實際上是通過將要安裝的軟件包列表作為setuptoolsinstall_requires選項setuptools ,因此這也是一個選項您可以遵循,而我認為這可以解決您的問題。

我實際上通過刪除我的requirements.txt文件並在setup.py文件中發布了我的應用程序正在使用的極少數附加庫來解決此問題(丟棄了Dataflow worker中已經提供的依賴項-https :// cloud .google.com / dataflow / docs / concepts / sdk-worker-dependencies#version-250_1 )。

不過,我不確定這是否是正確的解決方案,因為Github示例本身僅在我從setup.py文件中刪除pip install tensorflow命令pip install tensorflow

希望這對某人有幫助! :)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM