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

Cannot import name warnings from matplotlib.pyplot #224

Closed
domi04 opened this issue Jan 29, 2022 · 3 comments
Closed

Cannot import name warnings from matplotlib.pyplot #224

domi04 opened this issue Jan 29, 2022 · 3 comments

Comments

@domi04
Copy link

domi04 commented Jan 29, 2022

Hello, I was trying out the backtrader package which was installed without any problems. But when I try to run the example from the backtrader repository, it throws an error: ImportError: cannot import name 'warnings' from 'matplotlib.dates' (/private/var/containers/Bundle/Application/C9B292DD-07ED-4398-A1EC-D9D0AFFBE2CD/Carnets-sci.app/Library/lib/python3.9/site-packages/matplotlib/dates.py)

I'll add a screenshot, too

image

@domi04
Copy link
Author

domi04 commented Jan 29, 2022

I also tried to import the warnings manually, but that didn't work.
Another solution I found online was to uninstall matplotlib and reinstall it with the version 3.2.2 as this one seems to not have the warnings issue but it's not possible to uninstall matplotlib.
I would be happy if you have any other ideas to help me and thanks in advance.

@holzschu
Copy link
Owner

Good question. We cannot go back to matplotlib 3.2, which is indeed an issue.
The issue has been fixed on backtrader repository (mementum/backtrader#418), but the fix has not yet propagated to the pip repository. Probably the easiest path is to:

  • clone the backtrader repository (using either a-Shell or WorkingCopy)
  • navigate there using the file selector, create a new notebook in that directory
  • run "!python -m pip install ." or "!python setup.py install"

@domi04
Copy link
Author

domi04 commented Jan 29, 2022

I'll try that. Thanks for the fast response, you've done a great job with Carnets!

@domi04 domi04 closed this as completed Jan 29, 2022
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

2 participants