Process completed with exit code -1073740791 (0xC0000409) Error

Asked 2 years ago, Updated 2 years ago, 26 views

I'm learning Python by looking at online materials. I'm working on a noun frequency analyzer in the article. The name of the file that has been scratching the article is article_1.txt. I want to create an outtext.txt file and put the results of frequency analysis here An error such as Process completed with exit code -1073740791 (0xC0000409) appears.

When I googled, there was a story that it was an utf-8 encoding error, so I added encoding='utf-8' to the open function UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbf in position 32: invalid start byte appears.

It is still unresolved. The blog you refer to is https://livedata.tistory.com/19 The code I wrote is attached below, and I would really appreciate your help.

from konlpy.tag import Okt
from collections import Counter

#A function that calculates frequency after separating and extracting nouns from text.
def get_tags(text, ntags = 50):
    spliter = Okt()
    nouns =spliter.nouns(text)
    count = Counter(nouns)
    return_list = []
    """ The 'most_common' method of the 'counter' object is entered with an integer, and among the nouns in the object, 
   Returns objects stored by the number of integers entered in order from nouns with high frequency""""
    for n, c in count.most_common(ntags):
        temp = {'tag':n, 'count':c}
        return_list.append(temp)
    return  return_list

#Main function
def main():
    open_file_name = "article_1.txt"
    output_file_name = "outtest.txt"
    noun_count = 50
    open_text_file = open(open_file_name, 'r')
    text = open_text_file.read()
    tags = get_tags(text, noun_count)
    open_text_file.close()
    output_file = open(output_file_name, 'w')
    for tag in tags:
        noun = tag['tag']
        count = tag['count']
        output_file.write('{} {}\n'.format(noun, count))
    output_file.close()

if __name__ == '__main__':
    main()

python

2022-09-21 11:41

3 Answers

Okt works with jvm. It's not a Python library.

For use in konlpy, use jp type to communicate with python vm.

The important part should be the same bit as python vm and jvm

Use

or 64-bit python java or if 64-bit signed shall be used.


2022-09-21 11:41

Process finished with exit code -1073740791 (0xC0000409)

The above error is caused by the failure of the versions of jvm and python vm to be the same as 32 bits (or 64 bits if 64 bits).

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbd in position 2: invalid start byte

The above error is that the input string is not utf-8. If you check this part with an editor, you can check it.


2022-09-21 11:41

We solved the problem according to the blog below. Thank you to everyone who helped me.https://shwank77.tistory.com/1510


2022-09-21 11:41

If you have any answers or tips


© 2025 OneMinuteCode. All rights reserved.