- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我们正尝试使用 Pandas 从 BigQuery 中提取一些数据,并遇到了关于导入的绝对巨大的跟踪。据我所知,所有正确的依赖项都已安装。
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 879, in _find_spec
AttributeError: 'PyxImporter' object has no attribute 'find_spec'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run_forecasts.py", line 117, in <module>
run_forecasts()
File "run_forecasts.py", line 50, in run_forecasts
a.run()
File "./budgetforecastmodel/prepare/funnel_entrance.py", line 37, in run
self._project_id
File "./budgetforecastmodel/prepare/funnel_entrance.py", line 60, in _read_data
funnel_entrances = fe_query.run()
File "./budgetforecastmodel/extract/bigquery/biq_query_base.py", line 41, in run
self.read_data()
File "./budgetforecastmodel/extract/bigquery/biq_query_base.py", line 141, in read_data
self.df = pd.read_gbq(self.query, self.project_id)
File "./venv/lib/python3.6/site-packages/pandas/io/gbq.py", line 100, in read_gbq
**kwargs)
File "./venv/lib/python3.6/site-packages/pandas_gbq/gbq.py", line 906, in read_gbq
dialect=dialect, auth_local_webserver=auth_local_webserver)
File "./venv/lib/python3.6/site-packages/pandas_gbq/gbq.py", line 202, in __init__
self.credentials = self.get_credentials()
File "./venv/lib/python3.6/site-packages/pandas_gbq/gbq.py", line 214, in get_credentials
credentials = self.get_application_default_credentials()
File "./venv/lib/python3.6/site-packages/pandas_gbq/gbq.py", line 243, in get_application_default_credentials
credentials, _ = google.auth.default(scopes=[self.scope])
File "./venv/lib/python3.6/site-packages/google/auth/_default.py", line 281, in default
credentials, project_id = checker()
File "./venv/lib/python3.6/site-packages/google/auth/_default.py", line 158, in _get_gae_credentials
from google.auth import app_engine
File "./venv/lib/python3.6/site-packages/google/auth/app_engine.py", line 32, in <module>
from google.appengine.api import app_identity
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 946, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 881, in _find_spec
File "<frozen importlib._bootstrap>", line 855, in _find_spec_legacy
File "./venv/lib/python3.6/site-packages/pyximport/pyximport.py", line 253, in find_module
fp, pathname, (ext,mode,ty) = imp.find_module(fullname,package_path)
File "~/.pyenv/versions/3.6.1/lib/python3.6/imp.py", line 270, in find_module
"not {}".format(type(path)))
RuntimeError: 'path' must be None or a list, not <class '_frozen_importlib_external._NamespacePath'>
我们的需求文件如下所示:
cachetools==2.0.1
certifi==2017.7.27.1
chardet==3.0.4
et-xmlfile==1.0.1
fbprophet==0.2
google-api-python-client==1.6.4
google-auth==1.1.1
google-auth-httplib2==0.0.2
google-auth-oauthlib==0.1.1
httplib2==0.10.3
idna==2.6
jdcal==1.3
numpy==1.12.1
oauth2client==4.1.2
oauthlib==2.0.4
openpyxl==2.4.8
pandas==0.20.1
pandas-gbq==0.2.0
psycopg2==2.7.3.1
py==1.4.34
pyasn1==0.3.7
pyasn1-modules==0.1.5
pyodbc==4.0.17
pytest==3.2.2
python-dateutil==2.6.0
pytz==2017.2
PyYAML==3.12
requests==2.18.4
requests-oauthlib==0.8.0
rpy2==2.8.5
rsa==3.4.2
six==1.10.0
SQLAlchemy==1.1.9
sqlalchemy-redshift==0.6.0
uritemplate==3.0.0
urllib3==1.22
xlrd==1.1.0
这发生在具有全新虚拟环境的全新克隆上,在 OS X 上运行 Python 3.6.1。在两台机器上重现。老实说,甚至不知道从哪里开始。它以前工作过,但有些东西倒退导致它失败,但它死亡的方式表明它不完全是因为我们?
从字面上看,任何线索都会有所帮助! :)
最佳答案
这是一个错误,是由于 PyStan(Facebook 的 Prophet 使用)和其中一个 Google 身份验证库(BigQuery API 使用)之间的冲突。与 pyximport 的使用有关。
There's an issue on Prophet here您可以对其进行跟踪,但要找到修复程序似乎很困难。
关于python - 属性错误 : 'PyxImporter' object has no attribute 'find_spec' with Pandas/BigQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47335519/
你能比较一下属性吗 我想禁用文本框“txtName”。有两种方式 使用javascript,txtName.disabled = true 使用 ASP.NET, 哪种方法更好,为什么? 最佳答案 我
Count 属性 返回一个集合或 Dictionary 对象包含的项目数。只读。 object.Count object 可以是“应用于”列表中列出的任何集合或对
CompareMode 属性 设置并返回在 Dictionary 对象中比较字符串关键字的比较模式。 object.CompareMode[ = compare] 参数
Column 属性 只读属性,返回 TextStream 文件中当前字符位置的列号。 object.Column object 通常是 TextStream 对象的名称。
AvailableSpace 属性 返回指定的驱动器或网络共享对于用户的可用空间大小。 object.AvailableSpace object 应为 Drive 
Attributes 属性 设置或返回文件或文件夹的属性。可读写或只读(与属性有关)。 object.Attributes [= newattributes] 参数 object
AtEndOfStream 属性 如果文件指针位于 TextStream 文件末,则返回 True;否则如果不为只读则返回 False。 object.A
AtEndOfLine 属性 TextStream 文件中,如果文件指针指向行末标记,就返回 True;否则如果不是只读则返回 False。 object.AtEn
RootFolder 属性 返回一个 Folder 对象,表示指定驱动器的根文件夹。只读。 object.RootFolder object 应为 Dr
Path 属性 返回指定文件、文件夹或驱动器的路径。 object.Path object 应为 File、Folder 或 Drive 对象的名称。 说明 对于驱动器,路径不包含根目录。
ParentFolder 属性 返回指定文件或文件夹的父文件夹。只读。 object.ParentFolder object 应为 File 或 Folder 对象的名称。 说明 以下代码
Name 属性 设置或返回指定的文件或文件夹的名称。可读写。 object.Name [= newname] 参数 object 必选项。应为 File 或&
Line 属性 只读属性,返回 TextStream 文件中的当前行号。 object.Line object 通常是 TextStream 对象的名称。 说明 文件刚
Key 属性 在 Dictionary 对象中设置 key。 object.Key(key) = newkey 参数 object 必选项。通常是 Dictionary 
Item 属性 设置或返回 Dictionary 对象中指定的 key 对应的 item,或返回集合中基于指定的 key 的&
IsRootFolder 属性 如果指定的文件夹是根文件夹,返回 True;否则返回 False。 object.IsRootFolder object 应为&n
IsReady 属性 如果指定的驱动器就绪,返回 True;否则返回 False。 object.IsReady object 应为 Drive&nbs
FreeSpace 属性 返回指定的驱动器或网络共享对于用户的可用空间大小。只读。 object.FreeSpace object 应为 Drive 对象的名称。
FileSystem 属性 返回指定的驱动器使用的文件系统的类型。 object.FileSystem object 应为 Drive 对象的名称。 说明 可
Files 属性 返回由指定文件夹中所有 File 对象(包括隐藏文件和系统文件)组成的 Files 集合。 object.Files object&n
我是一名优秀的程序员,十分优秀!