安装在grpcio上的google-cloud-datastore的安装

时间:2020-09-02 11:21:29

标签: python-3.x google-app-engine google-cloud-platform google-cloud-datastore

我正在Google App Engine的Google Cloud Shell下进行开发

我能够使用数据存储和127.0.0.1上的所有功能,但是在进入生产之前,我将必须安装google-cloud-datastore

我使用以下命令:

pip install -t lib/ google-cloud-datastore --no-binary :all:

并获得如下信息:

Collecting pyasn1<0.5.0,>=0.4.6 (from pyasn1-modules>=0.2.1->google-auth<2.0dev,>=1.19.1->google-api-core[grpc]<2.0.0dev,>=1.14.0->google-cloud-datastore)
  Using cached https://files.pythonhosted.org/packages/a4/db/fffec68299e6d7bad3d504147f9094830b704527a7fc098b721d38cc7fa7/pyasn1-0.4.8.tar.gz
Skipping bdist_wheel for google-cloud-datastore, due to binaries being disabled for it.
Skipping bdist_wheel for google-api-core, due to binaries being disabled for it.
Skipping bdist_wheel for google-cloud-core, due to binaries being disabled for it.
Skipping bdist_wheel for googleapis-common-protos, due to binaries being disabled for it.
Skipping bdist_wheel for protobuf, due to binaries being disabled for it.
Skipping bdist_wheel for google-auth, due to binaries being disabled for it.
Skipping bdist_wheel for requests, due to binaries being disabled for it.
Skipping bdist_wheel for setuptools, due to binaries being disabled for it.
Skipping bdist_wheel for six, due to binaries being disabled for it.
Skipping bdist_wheel for pytz, due to binaries being disabled for it.
Skipping bdist_wheel for futures, due to binaries being disabled for it.
Skipping bdist_wheel for grpcio, due to binaries being disabled for it.
Skipping bdist_wheel for cachetools, due to binaries being disabled for it.
Skipping bdist_wheel for pyasn1-modules, due to binaries being disabled for it.
Skipping bdist_wheel for rsa, due to binaries being disabled for it.
Skipping bdist_wheel for chardet, due to binaries being disabled for it.
Skipping bdist_wheel for idna, due to binaries being disabled for it.
Skipping bdist_wheel for urllib3, due to binaries being disabled for it.
Skipping bdist_wheel for certifi, due to binaries being disabled for it.
Skipping bdist_wheel for enum34, due to binaries being disabled for it.
Skipping bdist_wheel for pyasn1, due to binaries being disabled for it.
ipython 5.10.0 has requirement prompt-toolkit<2.0.0,>=1.0.4, but you'll have prompt-toolkit 2.0.10 which is incompatible.
Installing collected packages: six, setuptools, protobuf, googleapis-common-protos, cachetools, pyasn1, pyasn1-modules, rsa, google-auth, chardet, idna, urllib3, 
certifi, requests, pytz, futures, enum34, grpcio, google-api-core, google-cloud-core, google-cloud-datastore
  Running setup.py install for six ... done
  Running setup.py install for setuptools ... done
  Running setup.py install for protobuf ... done
  Running setup.py install for googleapis-common-protos ... done
  Running setup.py install for cachetools ... done
  Running setup.py install for pyasn1 ... done
  Running setup.py install for pyasn1-modules ... done
  Running setup.py install for rsa ... done
  Running setup.py install for google-auth ... done
  Running setup.py install for chardet ... done
  Running setup.py install for idna ... done
  Running setup.py install for urllib3 ... done
  Running setup.py install for certifi ... done
  Running setup.py install for requests ... done
  Running setup.py install for pytz ... done
  Running setup.py install for futures ... done
  Running setup.py install for enum34 ... done
  Running setup.py install for grpcio ... /

最后一条语句 setup.py install for grpcio 的运行时间为25分钟。

如果我使用gcloud应用进行部署而没有完成 pip install google-cloud-datastore ,我会得到预期的结果:

   from google.cloud import datastore
ImportError: No module named cloud" 

1 个答案:

答案 0 :(得分:0)

万一有人试图在Google Cloud Shell上安装google-cloud-datastore

以下内容对我有用:

sudo  apt-get install python3-venv
python3 -m venv venv_gcd
source venv_gcd/bin/activate
pip install google-cloud-datastore