How to ingest Quandl - python

I am currently following a book(Trading Evolved) for learning the algorithmic trading but got **stuck on ingesting quandal what should I do now. I have tried to find the answer but can not get any solution for the same. PLEASE HELP
'''(zip35) C:\Users\jayan>zipline ingest -b quandl
Traceback (most recent call last):
File "C:\Users\jayan\anaconda3\envs\zip35\Scripts\zipline-script.py", line 33, in <module>
sys.exit(load_entry_point('zipline==1.4.1', 'console_scripts', 'zipline')())
File "C:\Users\jayan\anaconda3\envs\zip35\Scripts\zipline-script.py", line 25, in
importlib_load_entry_point
return next(matches).load()
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\importlib_metadata\__init__.py", line
100, in load
module = import_module(match.group('module'))
File "C:\Users\jayan\anaconda3\envs\zip35\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\__init__.py", line 29, in
<module>
from .utils.run_algo import run_algorithm
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\utils\run_algo.py", line 20, in
<module>
from zipline.data import bundles
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\__init__.py", line
2, in <module>
from . import quandl # noqa
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\quandl.py", line
16, in <module>
from . import core as bundles
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\bundles\core.py", line 15,
in <module>
from ..minute_bars import (
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\zipline\data\minute_bars.py", line 30, in
<module>
import tables
File "C:\Users\jayan\anaconda3\envs\zip35\lib\site-packages\tables\__init__.py", line 99, in <module>
from .utilsextension import (
ImportError: DLL load failed: The specified module could not be found.'''
Thank you to whoever replies to this.

Typically when there is a missing DLL in a Python package it's due to the absence of the C++ redistributable:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Related

"AttributeError: 'module' object has no attribute 'CUIAutomation"

Hello I've similar problem like this:
Py2Exe error caused by pywinauto on some systems: "AttributeError: 'module' object has no attribute 'CUIAutomation"
with py2exe and also pyinstaller I get error:
AttributeError: module 'comtypes.gen.UIAutomationClient' has no attribute 'CUIAutomation' [15964] Failed to execute script SVGWalker
Without py2exe or pyinstaller the script is running without errors !!
Here my startup python code:
#################################################################
# Version String
#################################################################
__version__ = "1.4.1.0"
#import WindowHandler
#import win32com.client
#import pywinauto
from pywinauto import application
from pywinauto import timings
from pywinauto import ElementNotFoundError
from pywinauto import Desktop
#import comtypes.client # 02.10.2020
import glob
import time
import sys
import os
import argparse
import traceback
import helper
import XmlManifest
and the error: with line 13 above:
Traceback (most recent call last):
File "SVGWalker.py", line 13, in <module>
from pywinauto import application
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pywinauto\__init__.py", line 89, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pywinauto\findwindows.py", line 42, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pywinauto\controls\__init__.py", line 36, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pywinauto\controls\uiawrapper.py", line 47, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "c:\python36\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 493, in exec_module
exec(bytecode, module.__dict__)
File "pywinauto\uia_defines.py", line 181, in <module>
File "pywinauto\uia_defines.py", line 169, in _build_pattern_ids_dic
File "pywinauto\uia_defines.py", line 50, in __call__
File "pywinauto\uia_defines.py", line 63, in __init__
AttributeError: module 'comtypes.gen.UIAutomationClient' has no attribute 'CUIAutomation'
[5732] Failed to execute script SVGWalker
Nothing in the thread above helped me.
Is there any other hint or solution

Python Sklearn / Scikit & cx_freeze: module 'sklearn.tree._criterion' has no attribute 'Criterion'

I am currently trying to put a Python app, which uses Sklearn modules, in a stand-alone .exe file.
My current cx_freeze setup.py looks like this:
import os
from cx_Freeze import setup, Executable
base = "Win32GUI"
os.environ['TCL_LIBRARY'] = r'C:\Users\...\AppData\Local\Continuum\anaconda3\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\...\AppData\Local\Continuum\anaconda3\tcl\tk8.6'
executables = [Executable("gui_handler.py", base=base)]
packages = ["idna", "numpy", "sklearn", "nltk", "stop_words", "scipy", "scipy.sparse.csgraph._validation",
"scipy.spatial.ckdtree", "PyQt5", "imblearn.under_sampling", "imblearn.over_sampling",
"sklearn.tree._criterion"]
options = {
'build_exe': {
"packages": packages,
"excludes": ["scipy.spatial.cKDTree"],
"zip_include_packages": ["sklearn", "nltk", "idna"] # PyQt5 zippen verschlechtert die Optik
},
}
setup(
name="<any name>",
options=options,
version="1.0",
description='<any description>',
executables=executables
)
It worked fine before but the latest version of my application uses the module imblearn. I think it causes this problem (appears a few seconds after double-clicking the .exe file):
Traceback (most recent call last):
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
module.run()
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
exec(code, m.__dict__)
File "gui_handler.py", line 8, in <module>
File "C:\Users\...\Documents\PycharmProjects\MachineLearning\build\exe.win-amd64-3.6\TextClassification\init_predict.py", line 16, in <module>
from imblearn.under_sampling import RandomUnderSampler
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\imblearn\under_sampling\__init__.py", line 6, in <module>
from .prototype_generation import ClusterCentroids
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\imblearn\under_sampling\prototype_generation\__init__.py", line 6, in <module>
from .cluster_centroids import ClusterCentroids
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\imblearn\under_sampling\prototype_generation\cluster_centroids.py", line 14, in <module>
from sklearn.cluster import KMeans
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\cluster\__init__.py", line 6, in <module>
from .spectral import spectral_clustering, SpectralClustering
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\cluster\spectral.py", line 17, in <module>
from ..manifold import spectral_embedding
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\manifold\__init__.py", line 9, in <module>
from .t_sne import TSNE
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\manifold\t_sne.py", line 25, in <module>
from . import _barnes_hut_tsne
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "ExtensionLoader_sklearn_manifold__barnes_hut_tsne.py", line 23, in <module>
File "ExtensionLoader_sklearn_manifold__barnes_hut_tsne.py", line 15, in __bootstrap__
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
File "sklearn\neighbors\quad_tree.pxd", line 54, in init sklearn.manifold._barnes_hut_tsne
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "ExtensionLoader_sklearn_neighbors_quad_tree.py", line 23, in <module>
File "ExtensionLoader_sklearn_neighbors_quad_tree.py", line 15, in __bootstrap__
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
File "sklearn\tree\_criterion.pxd", line 21, in init sklearn.neighbors.quad_tree
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\tree\__init__.py", line 6, in <module>
from .tree import DecisionTreeClassifier
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\tree\tree.py", line 40, in <module>
from ._criterion import Criterion
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "ExtensionLoader_sklearn_tree__criterion.py", line 23, in <module>
File "ExtensionLoader_sklearn_tree__criterion.py", line 15, in __bootstrap__
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
File "sklearn\tree\_splitter.pxd", line 34, in init sklearn.tree._criterion
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "ExtensionLoader_sklearn_tree__splitter.py", line 23, in <module>
File "ExtensionLoader_sklearn_tree__splitter.py", line 15, in __bootstrap__
File "C:\Users\...\AppData\Local\Continuum\anaconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
File "sklearn\tree\_criterion.pxd", line 21, in init sklearn.tree._splitter
AttributeError: module 'sklearn.tree._criterion' has no attribute 'Criterion'
I took a look in the sklearn\tree\tree.py file and there is indeed this import statement:
from ._criterion import Criterion
The same folder contains the files:
_criterion.cp36-win_amd64.pyd
_splitter.cp36-win_amd64.pyd
_tree.cp36-win_amd64.pyd
_utils.cp36-win_amd64.pyd
which are python module files as far as I know.
The application runs perfectly fine if I execute it from the PyCharm IDE so I would either assume that my program doesn't even need the Criterion module (and cx_freeze just loads it because it loads everything) and therefore I don't get the error message at runtime. Or that the module is actually missing.
Any ideas what could fix this problem?
Okay, I fixed the problem myself.
I just removed the line
zip_include_packages": ["sklearn", "nltk", "idna"]
from my cx_freeze_setup.py.

pip is showing error after downloading OPENSSL

pip command is showing error.
i downloaded libraries from https://github.com/rajpaul/igotoeurope/blob/master/requirements.txt then it started showing error in pip. i tried uninstalling the pip command and reinstalling the same still it didn't work.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/_vendor/init.py", line 33, in vendored
import(vendored_name, globals(), locals(), level=0)
ModuleNotFoundError: No module named 'pip._vendor.cachecontrol'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 22, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
vendored("cachecontrol")
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
__import__(modulename, globals(), locals(), level=0)
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/__init__.py", line 84, in <module>
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 46, in <module>
File "/home/aaroosh/.local/lib/python3.6/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/home/aaroosh/.local/lib/python3.6/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/home/aaroosh/.local/lib/python3.6/site-packages/OpenSSL/_util.py", line 3, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "/home/aaroosh/.local/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
AttributeError: module '_cffi_backend' has no attribute '_init_cffi_1_0_external_module'
I solved it by removing OPENSSL library.

I'm trying to train my own object-detection using tensorflow, but I get the following error

I'm trying to classify my own images in tensorflow.
I have entered the following command to train my model:
python3 train.py --logstderr --train_dir=training/ --
pipeline_config_path=training/ssd_mobilenet_v1_pets.config
From tutorial https://youtu.be/JR8CmWyh2E8?t=757 time 12:38
and I get the following error:
Traceback (most recent call last):
File "train.py", line 51, in <module>
from object_detection.builders import model_builder
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible
File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/protos/anchor_generator_pb2.py", line 27, in <module>
File "/usr/local/lib/python3.5/dist-packages/google/protobuf/descriptor.py", line 829, in _new_
return _message.default_pool.AddSerializedFile(serialized_pb)
TypeError: Couldn't build proto file into descriptor pool!
Invalid proto descriptor for file "object_detection/protos/anchor_generator.proto":
object_detection/protos/anchor_generator.proto: Import "object_detection/protos/grid_anchor_generator.proto" has not been loaded.
object_detection/protos/anchor_generator.proto: Import "object_detection/protos/ssd_anchor_generator.proto" has not been loaded.
object_detection.protos.AnchorGenerator.grid_anchor_generator: "object_detection.protos.GridAnchorGenerator" seems to be defined in "protos/grid_anchor_generator.proto", which is not imported by "object_detection/protos/anchor_generator.proto". To use it here, please add the necessary import.
object_detection.protos.AnchorGenerator.ssd_anchor_generator: "object_detection.protos.SsdAnchorGenerator" seems to be defined in "protos/ssd_anchor_generator.proto", which is not imported by "object_detection/protos/anchor_generator.proto". To use it here, please add the necessary import.
What have I done wrong? Thanks in advance.
Update:
I now get this error:
Traceback (most recent call last):
File "train.py", line 51, in <module>
from object_detection.builders import model_builder
File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/model_builder.py", line 17, in <module>
File "/usr/local/lib/python3.5/dist-packages/object_detection-0.1-py3.5.egg/object_detection/builders/anchor_generator_builder.py", line 20, in <module>
ImportError: cannot import name 'anchor_generator_pb2'

AttributeError in Py2exe

I made my py file executable using py2exe. My setup.py is as follows:
from distutils.core import setup
import py2exe
setup(windows=['main.py'])
When I tried to run main.exe, I get an error and was referred to main.log which reads:
Traceback (most recent call last):
File "main.py", line 20, in <module>
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "C:\Python34\lib\site-packages\pandas\__init__.py", line 7, in <module>
from . import hashtable, tslib, lib
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "<loader>", line 10, in <module>
File "<loader>", line 6, in __load
File "pandas\tslib.pyx", line 2839, in init pandas.tslib (pandas\tslib.c:79846)
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "<loader>", line 10, in <module>
File "<loader>", line 6, in __load
File "pandas\algos.pyx", line 64, in init pandas.algos (pandas\algos.c:179610)
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1191, in _load_unlocked
File "<frozen importlib._bootstrap>", line 1161, in _load_backward_compatible
File "<loader>", line 10, in <module>
File "<loader>", line 6, in __load
File "pandas\lib.pyx", line 1, in init pandas.lib (pandas\lib.c:77889)
AttributeError: 'module' object has no attribute '__pyx_capi__'
It looks like line 20 in my main.py file (import pandas as pd) triggered the problem. This type of error is referenced in a pull request here and they suggested adding a blank __init__.py file. I did so and got same result. I found a well commented post here (not directly dealing with py2exe) that suggests this might be due to mutual top-level imports or circular dependencies. This problem seems well known and has been mentioned at least twice on Stackoverflow in the past year (e.gs: here and here) but no clear solution has been given.
Perhaps we can get more clarity now with your feedback.
Python 3.4.2; py2exe 0.9.2.0
Was running into the same issue with pandas, but I got it working after updating to the most recent version.
It seems this error was recently addressed, and was resolved in Pandas 15.2
https://github.com/pydata/pandas/issues/8602
I was running in the same errors with Python 3.4.4.
My solution was to fix the import statement in C:\Pythob34\lib\site-packagespythoncom.py.
Original:
import pywintypes
pywintypes.import_pywin32_system_module("pythoncom", globals())
Changed To:
from pywintypes import import_pywin32_system_module
import_pywin32_system_module("pythoncom", globals())

Categories

Resources