Closed bkc39 closed 7 years ago
Looks like this also affects catalyst ingest
:
(catalyst-venv) bash-3.2$ catalyst ingest
catalyst ingest
Traceback (most recent call last):
File "/Users/bkc/Documents/code/projects/catalyst/catalyst-venv/bin/catalyst", line 7, in <module>
from catalyst.__main__ import main
File "/Users/bkc/Documents/code/projects/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/__init__.py", line 20, in <module>
from . import data
File "/Users/bkc/Documents/code/projects/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/__init__.py", line 1, in <module>
from . import loader
File "/Users/bkc/Documents/code/projects/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/data/loader.py", line 36, in <module>
from catalyst.curate.poloniex import PoloniexCurator
File "/Users/bkc/Documents/code/projects/catalyst/catalyst-venv/lib/python3.6/site-packages/catalyst/curate/poloniex.py", line 9
DT_START = time.mktime(datetime(2010, 01, 01, 0, 0).timetuple())
The fix is straightforward, but then this module starts complaining about mixing tabs and spaces. When that is done I get:
(catalyst-venv) Bens-MacBook-Pro:catalyst bkc$ python
Python 3.6.1 (default, Apr 4 2017, 09:40:21)
[GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> from catalyst.api import cancel_order
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bkc/Documents/code/projects/catalyst/catalyst/__init__.py", line 20, in <module>
from . import data
File "/Users/bkc/Documents/code/projects/catalyst/catalyst/data/__init__.py", line 1, in <module>
from . import loader
File "/Users/bkc/Documents/code/projects/catalyst/catalyst/data/loader.py", line 37, in <module>
from catalyst.utils.calendars import get_calendar
File "/Users/bkc/Documents/code/projects/catalyst/catalyst/utils/calendars/__init__.py", line 16, in <module>
from .trading_calendar import TradingCalendar
File "/Users/bkc/Documents/code/projects/catalyst/catalyst/utils/calendars/trading_calendar.py", line 30, in <module>
from catalyst.utils.calendars._calendar_helpers import (
ModuleNotFoundError: No module named 'catalyst.utils.calendars._calendar_helpers'
Are we sure that the catalyst
source directory is added to PYTHONPATH
when the virtualenv is fired up?
If not, I can add the .pth
to catalyst-venv
site packages.
The formatting and indentation problems were solved by this pull request: https://github.com/enigmampc/catalyst/pull/4
For others who encounter the latter bug, this seems to have been caused by running the python interpreter from the repository's working directory, as this causes it to import the source files directly, instead of the importing the files installed in the virtualenv or in the user's site-packages. The above error is failing to find one of the compiled classes, _calendar_helpers, that does not get built in the source directory. It's probably best to avoid importing catalyst from any file in the repo's top-level directory to avoid confusion.
Thanks @bkc39 for your help on this issue!
Dear Zipline Maintainers,
Before I tell you about my issue, let me describe my environment:
Environment
Operating System:
Python Version:
Python Bitness:
How did you install Zipline: Installed from source using
README.rst
.Python packages:
Now that you know a little about me, let me tell you about the issue I am having:
Description of Issue
Example
What did you expect to happen? Expected library to import with no errors.
What happened instead?
Got an error about an invalid literal. Looks like a typo
Here is how you can reproduce this issue on your machine:
Reproduction Steps
What steps have you taken to resolve this already?
Should be a simple fix. Just logging here
Anything else?
Nope
Sincerely, Ben