question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Science" style not found on Google Colab

See original GitHub issue

Hey there!

Thanks for the amazing project! Really useful for upcoming submissions 😅

Though, I ran into an issue when trying it out on Google Colab. I pip installed the style library following the instructions on the README. I then wrote down

import matplotlib.pyplot as plt

plt.style.use(['science','ieee'])

and it gave me the following error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/matplotlib/style/core.py in use(style)
    113             try:
--> 114                 rc = rc_params_from_file(style, use_default_template=False)
    115                 _apply_style(rc)

5 frames
FileNotFoundError: [Errno 2] No such file or directory: 'science'

During handling of the above exception, another exception occurred:

OSError                                   Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/matplotlib/style/core.py in use(style)
    118                     "{!r} not found in the style library and input is not a "
    119                     "valid URL or path; see `style.available` for list of "
--> 120                     "available styles".format(style))
    121 
    122 

OSError: 'science' not found in the style library and input is not a valid URL or path; see `style.available` for list of available styles

Any remedies for this would be awesome!

Thanks 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
garrettj403commented, May 16, 2021

Hi @rish-16

Does this work?

import matplotlib.pyplot as plt
plt.style.reload_library()
plt.style.use('science')
0reactions
979736316commented, Dec 13, 2022

Sure!

Read more comments on GitHub >

github_iconTop Results From Across the Web

matplotlib-SciencePlots package cannot run - Stack Overflow
OSError : 'science' not found in the style library and input is not a valid URL or path; see `style.available` for list of...
Read more >
SciencePlots - PyPI
This repo has Matplotlib styles to format your figures for scientific papers, presentations and theses. You can find the full gallery of included...
Read more >
Customizing Matplotlib: Configurations and Stylesheets
Even if you don't create your own style, the stylesheets included by default are extremely useful. The available styles are listed in plt.style.available...
Read more >
Latex + matplotlib + google colab - learnsharewithdp
The above error says that the file `type1ec.sty' not found. This error goes away by installing cm-super . I installed it by executing...
Read more >
How to resolve module not found error in google colab?
How to resolve module not found error in google colab? · + 1. This is in the docs, see https://colab.research.google.com/notebooks/snippets/importing_libraries.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found