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

"FileNotFoundError" is raised. #10

Open
EngYOSHI opened this issue Oct 4, 2024 · 1 comment
Open

"FileNotFoundError" is raised. #10

EngYOSHI opened this issue Oct 4, 2024 · 1 comment

Comments

@EngYOSHI
Copy link

EngYOSHI commented Oct 4, 2024

Windows 11
python 3.12.3
charamel==1.0.0

I installed charamel using pip.
An error occurs when charamel.Detector() is executed.

code:

import charamel
detector = charamel.Detector()

error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\charamel\detector.py", line 67, in __init__
    self._weights = load_weights(encodings)
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\charamel\resources\__init__.py", line 71, in load_weights
    weights[encoding] = _unpack(WEIGHT_DIRECTORY / f'{encoding}.gzip', pattern='>e')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\charamel\resources\__init__.py", line 29, in _unpack
    with gzip.open(file, 'rb') as data:
         ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\gzip.py", line 61, in open
    binary_file = GzipFile(filename, gz_mode, compresslevel)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\gzip.py", line 192, in __init__
    fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\charamel\\resources\\weights\\Encoding.ASCII.gzip'

 
 
For reference, here are the contents of the charamel\resources\weights directory. The file name seems to be wrong.

C:\Users\user\AppData\Local\Programs\Python\Python312\Lib\site-packages\charamel\resources\weights> dir /b
ascii.gzip
big5.gzip
big5hkscs.gzip
cp037.gzip
cp1006.gzip
cp1026.gzip
cp1125.gzip
cp1140.gzip
cp1250.gzip
cp1251.gzip
cp1252.gzip
cp1253.gzip
cp1254.gzip
cp1255.gzip
cp1256.gzip
cp1257.gzip
cp1258.gzip
cp273.gzip
cp424.gzip
cp437.gzip
cp500.gzip
cp720.gzip
cp737.gzip
cp775.gzip
cp850.gzip
cp852.gzip
cp855.gzip
cp856.gzip
cp857.gzip
cp858.gzip
cp860.gzip
cp861.gzip
cp862.gzip
cp863.gzip
cp864.gzip
cp865.gzip
cp866.gzip
cp869.gzip
cp874.gzip
cp875.gzip
cp932.gzip
cp949.gzip
cp950.gzip
euc_jisx0213.gzip
euc_jis_2004.gzip
euc_jp.gzip
euc_kr.gzip
gb18030.gzip
gb2312.gzip
gbk.gzip
hz.gzip
iso2022_jp.gzip
iso2022_jp_1.gzip
iso2022_jp_2.gzip
iso2022_jp_2004.gzip
iso2022_jp_3.gzip
iso2022_jp_ext.gzip
iso2022_kr.gzip
iso8859_10.gzip
iso8859_11.gzip
iso8859_13.gzip
iso8859_14.gzip
iso8859_15.gzip
iso8859_16.gzip
iso8859_2.gzip
iso8859_3.gzip
iso8859_4.gzip
iso8859_5.gzip
iso8859_6.gzip
iso8859_7.gzip
iso8859_8.gzip
iso8859_9.gzip
johab.gzip
koi8_r.gzip
koi8_t.gzip
koi8_u.gzip
kz1048.gzip
latin_1.gzip
mac_cyrillic.gzip
mac_greek.gzip
mac_iceland.gzip
mac_latin2.gzip
mac_roman.gzip
mac_turkish.gzip
ptcp154.gzip
shift_jis.gzip
shift_jisx0213.gzip
shift_jis_2004.gzip
tis_620.gzip
utf_16.gzip
utf_16_be.gzip
utf_16_le.gzip
utf_32.gzip
utf_32_be.gzip
utf_32_le.gzip
utf_7.gzip
utf_8.gzip
utf_8_sig.gzip
@EngYOSHI
Copy link
Author

EngYOSHI commented Oct 4, 2024

I didn't see a supported version, I confirmed that it works with python 3.9.13. Are there any plans to support python 3.12 series?

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