-
Notifications
You must be signed in to change notification settings - Fork 0
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
ModuleNotFoundError: No module named 'string_utils_py' #3
Comments
Hi! Did you install the dependencies from requirements.txt? |
I've tried to install. Several dependencies has failed to install:
|
Even when translating the error message, I do not understand how the code could cause it. Do you have anything else running simultaneously that has access to the files? Admittedly, I haven't tried running this code on Windows. I just ran it successfully on Linux with the following commands:
As a last resort, If you really want this to run on Windows, maybe you could try running it in the Windows Subsystem for Linux. |
Thx for answer. I've tried to install it manually using requirements.txt and got this. If try to use the command: C:\Work\OpenSource\lnk_parser\master>c:\python\x64\310\python -m pip install -r requirements.txt It reports another error:
But it somehow installed and if run: c:\Work\OpenSource\lnk_parser\master>c:\python\x64\310\python lnk_parser.py d:\1.txt.lnk
Traceback (most recent call last):
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser.py", line 40, in <module>
main()
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser.py", line 26, in main
text='\n\n'.join(
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser.py", line 29, in <genexpr>
f'{ShellLink.from_bytes(data=lnk_file.read())}'
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser\structures\shell_link.py", line 54, in from_bytes
link_info = LinkInfo.from_bytes(data=data, base_offset=offset)
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser\structures\link_info.py", line 72, in from_bytes
local_base_path=_read_null_terminated_string(
File "c:\Work\OpenSource\lnk_parser\master\lnk_parser\utils.py", line 35, in _read_null_terminated_string
bytes(data[offset:offset + num_string_bytes]).decode(encoding=('utf-16-le' if is_unicode else 'ascii')),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 3: ordinal not in range(128) This error already known from another app: strayge/pylnk#20 (comment) I just searching a solution for this. |
Glad that it is running, and thanks for the additional info. The code is having a problem reading the local base path of the When debugging, I can see that the local base path bytes are extracted correctly:
Now for the cause of the problem: When attempting to decode bytes that are not Unicode-encoded, I have defaulted to using Maybe you could help me figure how to obtain that value? When making whatever call for it, you should probably receive something other than |
May be these help.
Also the explicit way I think would be as good too:
|
Thanks! As indicated in the thread of the issue you referred to,
Using When setting the encoding to
|
Sorry, I thought the output of
|
|
I have updated the repository. If you run the latest version, I believe it will run successfully with your file. |
I am closing this issue as I believe the problem alluded to is solved. I will re-open it if there are any indications that it is not. |
The text was updated successfully, but these errors were encountered: