-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: Failed to find any assets with country_code 'US' (temp. solved) #2517
Comments
Still the same error for me... |
Also encounter the same issue since I started using Zipline. I am setting manually the country code to 'US' as suggest above every time I ingest new data, but I'm pretty sure it's not the normal procedure. Has anyone a better solution? could this be worked around by tweaking the ingest function? |
If it can help anyone, I solved the issue by feeding the exchanges table directly in the ingest function. It looks like that:
|
@rcardinaux can you expand your solution a bit? where can I find the ingest function? |
@chunghoony : you can create your own ingest function and save it in the bundle folder of zipline. The path to that folder is the following in my environment: The script where you define the ingest function is ultimately run whith the following command: The links below have been useful in writing my script custom_data: You won't be able to use my code as such, since I'm exporting data from an SQL database, but here is the content of my custom_data.py file:
|
This worked or me. Make sure you save the database instead of closing the app(apply does not perm save it) |
I know I am commenting so late but this fixed the issue for me.
|
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Linux 5.1.15-arch1-1-ARCH #1 SMP PREEMPT Tue Jun 25 04:49:39 UTC 2019 x86_64 GNU/Linux
2.7
64
pip
appdirs==1.4.3 asn1crypto==0.24.0 backports.functools-lru-cache==1.5 bcolz==0.12.1 Bottleneck==1.2.1 bzr==2.7.0 CacheControl==0.12.5 ceph-detect-init==1.0.1 ceph-disk==1.0.0 ceph-volume==1.0.0 cephfs==2.0.0 certifi==2019.6.16 cffi==1.12.3 chardet==3.0.4 Cheetah==2.4.4 Click==7.0 colorama==0.4.1 contextlib2==0.5.5 cryptography==2.7 cycler==0.10.0 cyordereddict==1.0.0 Cython==0.29.13 decorator==4.4.0 distlib==0.2.9 distro==1.4.0 dlib==19.16.0 empyrical==0.5.0 enum34==1.1.6 face-recognition==1.2.3 face-recognition-models==0.3.0 Flask==1.0.2 Flask-OAuth==0.12 funcsigs==1.0.2 future==0.17.1 gWakeOnLAN==0.6.3 h5py==2.9.0 html5lib==1.0.1 httplib2==0.12.1 idna==2.8 inflection==0.3.1 intervaltree==3.0.2 ipaddress==1.0.22 ipcalc==1.99.0 iso3166==1.0 iso8601==0.1.12 itsdangerous==1.1.0 Jinja2==2.10 kiwisolver==1.1.0 lockfile==0.12.2 Logbook==1.4.3 louis==3.10.0 lru-dict==1.1.6 lxml==4.3.4 Mako==1.0.14 Markdown==3.1.1 MarkupSafe==1.1.0 matplotlib==2.2.4 mock==3.0.5 more-itertools==5.0.0 msgpack==0.6.1 multipledispatch==0.6.0 mysql-connector-python==8.0.15 MySQL-python==1.2.5 ndg-httpsclient==0.5.1 netsnmp-python==1.0a1 networkx==1.11 numarray==1.5.2 numexpr==2.6.9 numpy==1.16.4 oauth2==1.9.0.post1 packaging==19.0 pandas==0.22.0 pandas-datareader==0.7.4 paranoid==1.1.1 patsy==0.5.1 pep517==0.5.0 pexpect==4.7.0 Pillow==5.3.0 progress==1.5 ptyprocess==0.6.0 pyasn1==0.4.6 PyAutoGUI==0.9.42 pycairo==1.18.1 pycparser==2.19 pycryptodome==3.8.2 PyGetWindow==0.0.4 PyGObject==3.32.2 PyMsgBox==1.0.6 PyOpenGL==3.1.0 pyOpenSSL==19.0.0 pyparsing==2.4.0 PyQt4-sip==4.19.16 PyQt5==5.12.3 PyQt5-sip==4.19.17 PyRect==0.1.4 PyScreeze==0.1.20 pyserial==3.4 python-dateutil==2.8.0 python-editor==1.0.4 python-interface==1.5.1 pytoml==0.1.20 PyTweening==1.0.3 pytz==2019.2 pyxdg==0.26 PyYAML==3.13 Quandl==3.4.8 rados==2.0.0 rbd==2.0.0 requests==2.22.0 requests-file==1.4.3 retrying==1.3.3 rgw==2.0.0 scikit-learn==0.20.4 scipy==1.2.1 serial==0.0.70 sip==4.19.17 six==1.12.0 sortedcontainers==2.1.0 SQLAlchemy==1.3.6 statsmodels==0.10.1 subprocess32==3.5.4 tables==3.5.2 team==1.0 toolz==0.10.0 trading-calendars==1.8.1 typing==3.7.4 urllib3==1.25.3 virtualenv==16.1.0 webencodings==0.5.1 Werkzeug==0.14.1 wrapt==1.11.2 wxPython==3.0.2.0 wxPython-common==3.0.2.0 zenmap==7.70 zipline==1.3.0+366.g950f7b28.dirty
Now that you know a little about me, let me tell you about the issue I am
having:
Description of Issue
ValueError: Failed to find any assets with country_code 'US' that traded between 2018-01-02 00:00:00+00:00 and 2018-01-09 00:00:00+00:00.This probably means that your asset db is old or that it has incorrect country/exchange metadata.
Here is how you can reproduce this issue on your machine:
Reproduction Steps
What steps have you taken to resolve this already?
The error is caused because the country_code in the Database is somehow messed up.
~/.zipline/data/quandl/TIMESTAMP/assets-n.sqlite
):1.2. Go to the 'exchanges' Table and change country_code to 'US'. Mine was set to '???'
1.3. I used 'DB Browser for SQLite' which has an easy GUI Interface just for the record.
Anything else?
I don't really know if it was necessary to open this issue, as i already resolved it, but it had driven me crazy, so if anyone else has this Problem, here is a temporary solution.
Sincerely,
mowoe
The text was updated successfully, but these errors were encountered: