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.

error saving files

See original GitHub issue

I installed the API and run the next couple of code lines. I got an error when I wanted to save the filing.

from secedgar.filings import FilingType, Filing
from datetime import datetime

filing = Filing(cik_lookup='aapl',
                filing_type=FilingType.FILING_10K,
                start_date=datetime(2015, 1, 1),
                end_date=datetime(2019, 1, 1))

filing.save('./reports')

The following error is rising when I run the last command:

`--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-9-ae9d2e927b58> in <module> ----> 1 filing.save(‘FFS’)

~.conda\envs\Keras\lib\site-packages\secedgar\filings\filing.py in save(self, directory, dir_pattern, file_pattern) 222 223 loop = asyncio.get_event_loop() –> 224 loop.run_until_complete(self.client.wait_for_download_async(inputs))

~.conda\envs\Keras\lib\asyncio\base_events.py in run_until_complete(self, future) 568 future.add_done_callback(_run_until_complete_cb) 569 try: –> 570 self.run_forever() 571 except: 572 if new_task and future.done() and not future.cancelled():

~.conda\envs\Keras\lib\asyncio\base_events.py in run_forever(self) 523 self._check_closed() 524 if self.is_running(): –> 525 raise RuntimeError(‘This event loop is already running’) 526 if events._get_running_loop() is not None: 527 raise RuntimeError(

RuntimeError: This event loop is already running 10it [00:01, 9.88it/s]`

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:47 (32 by maintainers)

github_iconTop GitHub Comments

2reactions
esvhdcommented, Mar 6, 2021

Hi guys, let me try this later and will let you know. Thanks!

Sent from my iPhone

On 5 Mar 2021, at 23:19, Peter Stenger notifications@github.com wrote:

@esvhd Here is a link to a guide for something that @jackmoody11 outlined. https://help.dreamhost.com/hc/en-us/articles/115000695551-Installing-and-using-virtualenv-with-Python-3

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

1reaction
esvhdcommented, Mar 9, 2021

@esvhd I just merged a PR into master that adds tqdm as a requirement, so that should be fixed now. Working on finalizing v0.3.3 release so that we can release that.

Can you try running the code without nest_asyncio? We are trying to determine if a fresh install will let you run the code without any issues or if it is a bug.

Hi @jackmoody11 - I just tried WITHOUT importing nest_asyncio in my newly created environment, after saving to ./edgar as @reteps suggested, the download worked as expected.

FYI - Interestingly, in my old base conda environment, without nest_asyncio, with ./edgar it still did not work…

Looks like it was related to save().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error saving to file (Error 31036) - Microsoft Learn
Visual Basic can't write the object to the specified file (set Action = 11 or 18). Possible causes: The FileNumber property is invalid....
Read more >
Error saving files - Apple Support Communities
Hello,. When I try to save my file to my icloud drive I get an error saying "The Operation couldn't be completed. No...
Read more >
How to Fix the "Word Cannot Complete the Save Due to a File ...
How to Fix the "Word Cannot Complete the Save Due to a File Permission Error" Issue on Windows · 1. Try Saving the...
Read more >
Cannot Save Files to Desktop and Error “File not found” in ...
Option 1: Turn Off Controlled Folder Access · Open Windows Defender Security Center · Click Virus & threat protection · Click Virus &...
Read more >
How to Fix Documents Not Saving on macOS 10.15
If you can't save a document using Word for Mac OS 10.15 due to an error message that states that “the document cannot...
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