dgunning / edgartools

Navigate SEC Edgar data in Python
MIT License
445 stars 87 forks source link

import error #62

Closed crunchanalytic closed 3 months ago

crunchanalytic commented 3 months ago

Import error

from edgar import * This worked well 2 days ago. Now I get this:


ImportError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from edgar import *

File ~\anaconda3\Lib\site-packages\edgar__init__.py:9 6 from functools import partial 7 from typing import Optional, Union, List ----> 9 from edgar.entities import (Company, 10 CompanyData, 11 CompanyFacts, 12 CompanySearchResults, 13 CompanyFilings, 14 CompanyFiling, 15 Entity, 16 EntityData, 17 find_company, 18 get_entity, 19 get_company_facts, 20 get_company_tickers, 21 get_entity_submissions, 22 get_ticker_to_cik_lookup, 23 get_cik_lookup_data) 24 from edgar._filings import (Filing, 25 Filings, 26 FilingHeader, (...) 32 get_by_accession_number, 33 FilingHomepage) 34 from edgar.core import (edgar_mode, 35 CRAWL, 36 CAUTION, 37 NORMAL, 38 get_identity, 39 set_identity)

File ~\anaconda3\Lib\site-packages\edgar\entities.py:17 14 from rich.panel import Panel 15 from rich.text import Text ---> 17 from edgar._filings import Filing, Filings, FilingsState 18 from edgar._rich import df_to_rich_table, repr_rich 19 from rich import box

File ~\anaconda3\Lib\site-packages\edgar_filings.py:36 33 from rich.text import Text 35 from edgar._markdown import html_to_markdown, text_to_markdown ---> 36 from edgar._party import Address 37 from edgar._rich import df_to_rich_table, repr_rich 38 from edgar._xbrl import FilingXbrl

File ~\anaconda3\Lib\site-packages\edgar_party.py:12 10 from edgar._rich import repr_rich 11 from edgar._xml import child_text, child_value ---> 12 from edgar.core import IntString 14 all = [ 15 'Address', 16 'Issuer', (...) 20 'get_addresses_as_columns' 21 ] 24 class Address(BaseModel):

File ~\anaconda3\Lib\site-packages\edgar\core.py:20 18 import pyarrow as pa 19 import pyarrow.compute as pc ---> 20 from charset_normalizer import detect 21 from fastcore.basics import listify 22 from rich.logging import RichHandler

File ~\anaconda3\Lib\site-packages\charset_normalizer__init.py:23 1 """ 2 Charset-Normalizer 3 ~~~~~~ (...) 21 :license: MIT, see LICENSE for more details. 22 """ ---> 23 from charset_normalizer.api import from_fp, from_path, from_bytes, normalize 24 from charset_normalizer.legacy import detect 25 from charset_normalizer.version import version__, VERSION

File ~\anaconda3\Lib\site-packages\charset_normalizer\api.py:10 7 PathLike = Union[str, 'os.PathLike[str]'] # type: ignore 9 from charset_normalizer.constant import TOO_SMALL_SEQUENCE, TOO_BIG_SEQUENCE, IANA_SUPPORTED ---> 10 from charset_normalizer.md import mess_ratio 11 from charset_normalizer.models import CharsetMatches, CharsetMatch 12 from warnings import warn

File ~\anaconda3\Lib\site-packages\charset_normalizer\md.py:5 2 from typing import Optional, List 4 from charset_normalizer.constant import UNICODE_SECONDARY_RANGE_KEYWORD ----> 5 from charset_normalizer.utils import is_punctuation, is_symbol, unicode_range, is_accentuated, is_latin, \ 6 remove_accent, is_separator, is_cjk, is_case_variable, is_hangul, is_katakana, is_hiragana, is_ascii, is_thai 9 class MessDetectorPlugin: 10 """ 11 Base abstract class used for mess detection plugins. 12 All detectors MUST extend and implement given methods. 13 """

ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (C:\Users\crunc\anaconda3\Lib\site-packages\charset_normalizer\constant.py)


I assume this is affecting other users?

Thank you for your work. -m

dgunning commented 3 months ago

Hello,

What does this return

pip show charset-normalizer
crunchanalytic commented 3 months ago

Thank you for your prompt reply. I am updating my system, so I'm unable to check right now.

PS - I wish I would have noticed that you added the more precise balance sheet items, before I created them for myself last week! LOL!

On Fri, Jun 14, 2024, 8:14 AM Dwight Gunning @.***> wrote:

Hello,

What does this return

pip show charset-normalizer

— Reply to this email directly, view it on GitHub https://github.com/dgunning/edgartools/issues/62#issuecomment-2167893009, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJGI6P2KMCGARIGAP3I4C7DZHLNA7AVCNFSM6AAAAABJKF3DQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRXHA4TGMBQHE . You are receiving this because you authored the thread.Message ID: @.***>

crunchanalytic commented 3 months ago

Is this helpful at all? Thank you again for your trouble. -mark

On Fri, Jun 14, 2024, 8:20 AM Mark FromCrunchAnalytic < @.***> wrote:

Thank you for your prompt reply. I am updating my system, so I'm unable to check right now.

PS - I wish I would have noticed that you added the more precise balance sheet items, before I created them for myself last week! LOL!

On Fri, Jun 14, 2024, 8:14 AM Dwight Gunning @.***> wrote:

Hello,

What does this return

pip show charset-normalizer

— Reply to this email directly, view it on GitHub https://github.com/dgunning/edgartools/issues/62#issuecomment-2167893009, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJGI6P2KMCGARIGAP3I4C7DZHLNA7AVCNFSM6AAAAABJKF3DQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRXHA4TGMBQHE . You are receiving this because you authored the thread.Message ID: @.***>

dgunning commented 3 months ago

Sorry, what's helpful .. did you add something to the issue thread?

crunchanalytic commented 3 months ago

Sorry, no. I emailed you a screenshot of the show charset-normalizer, you asked for.

On Fri, Jun 14, 2024, 10:00 AM Dwight Gunning @.***> wrote:

Sorry, what's helpful .. did you add something to the issue thread?

— Reply to this email directly, view it on GitHub https://github.com/dgunning/edgartools/issues/62#issuecomment-2168116655, or unsubscribe https://github.com/notifications/unsubscribe-auth/BJGI6P2FVN4VY4CMB722463ZHLZQXAVCNFSM6AAAAABJKF3DQ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYGEYTMNRVGU . You are receiving this because you authored the thread.Message ID: @.***>

dgunning commented 3 months ago

I don't see the screenshot in the email chain

radhika3558 commented 3 months ago

I'm having the same issue. I'm not able to import individual functions (eg, Company, set_identity, etc) or * It was working fine last week.

dgunning commented 3 months ago

Can you show me the result of

pip show charset-normalizer
radhika3558 commented 3 months ago

Hello,

Is this what you mean?

Screenshot 2024-06-17 at 6 10 12 PM
dgunning commented 3 months ago

Thanks. I will release a new version maybe tomorrow without charset-normalizer

radhika3558 commented 3 months ago

Thank you so much!

dgunning commented 3 months ago

Released 2.24.3. Please try it and let me know

radhika3558 commented 3 months ago

Still having trouble importing

screenshot
dgunning commented 3 months ago

You might have another package shadowing edgartools.

Try

pip uninstall edgar 
pip install -U edgartools
radhika3558 commented 3 months ago

That helped! Thank you for being so responsive and creating edgartools!

dgunning commented 3 months ago

Great. Closing as fixed