Skip to content
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

Error while downloading the data #2

Closed
R1j1t opened this issue Aug 24, 2018 · 1 comment
Closed

Error while downloading the data #2

R1j1t opened this issue Aug 24, 2018 · 1 comment

Comments

@R1j1t
Copy link

R1j1t commented Aug 24, 2018

I download the Problem 3 folder and executed problem3_template.py and I am getting the following error:

Processing data for stock: EXR
Processing data for stock: BYB
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/backtester/timeRule/nse_time_rule.py", line 31, in getNSEHolidays
    soup = BeautifulSoup(content, 'lxml')
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/bs4/__init__.py", line 198, in __init__
    % ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "problem3_template.py", line 176, in <module>
    tradingSystem = TradingSystem(tsParams)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/backtester/trading_system.py", line 49, in __init__
    self.tsParams.getTimeRuleForUpdates(), self.initializer)
  File "/Users/rajat/Desktop/placementTests/qq-optiver/problem3/problem3_trading_params.py", line 62, in getTimeRuleForUpdates
    return NSETimeRule(startDate=self.__startDate, endDate=self.__endDate, startTime='15:30', frequency='M', sample='1440')
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/backtester/timeRule/nse_time_rule.py", line 15, in __init__
    super(NSETimeRule, self).__init__(startDate = startDate, endDate = endDate, startTime = startTime, endTime= endTime, holidays = self.getNSEHolidays(), frequency = frequency, sample = sample)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/backtester/timeRule/nse_time_rule.py", line 37, in getNSEHolidays
    except HTTPError as e:
NameError: name 'HTTPError' is not defined

Can you please point out the problem.

Python 3.5.4
OS: Mac OS High Sierra

@R1j1t
Copy link
Author

R1j1t commented Aug 24, 2018

Solved the issue.

For this exception
Couldn't find a tree builder with the features you requested: lxml. Do you need to install a parser library?
use
pip3 install lxml

and for name 'HTTPError' is not defined

update the nse_time_rule.py file with HTTPError import. I have also created a pull request on bitbucket. Closing this issue.

@R1j1t R1j1t closed this as completed Aug 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant