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

import function bug #193

Closed
SeverusYixin opened this issue Sep 4, 2024 · 8 comments
Closed

import function bug #193

SeverusYixin opened this issue Sep 4, 2024 · 8 comments

Comments

@SeverusYixin
Copy link
Collaborator

SeverusYixin commented Sep 4, 2024

Hi @haesleinhuepf, after directly importing your code, with:

from generate_link_lists import read_yaml_file, load_dataframe
from _github_utilities import get_github_repository

it shows me as:

C:\Users\huang\Documents\GitHub\training\scripts>streamlit run appsubmitter.py

You can now view your Streamlit app in your browser.

Local URL: http://localhost:8501
Network URL: http://172.26.44.166:8501

Adding nfdi4bioimage.yml
Adding nfdi4bioimage.yml
2024-09-04 13:10:58.472 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\huang\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 85, in exec_func_with_error_handling
result = func()
^^^^^^
File "C:\Users\huang\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 576, in code_to_exec
exec(code, module.dict)
File "C:\Users\huang\Documents\GitHub\training\scripts\appsubmitter.py", line 120, in
unique_tags, unique_types, unique_licenses = get_unique_values_from_yamls(directory_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\appsubmitter.py", line 44, in get_unique_values_from_yamls
df = load_dataframe(resources_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 102, in load_dataframe
content = all_content(directory_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 92, in all_content
new_content = read_yaml_file(directory_path + filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 120, in read_yaml_file
with open(filename, 'r', encoding="utf8") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '..\resourcesnfdi4bioimage.yml'
2024-09-04 13:10:58.472 Uncaught app exception
Traceback (most recent call last):
File "C:\Users\huang\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\exec_code.py", line 85, in exec_func_with_error_handling
result = func()
^^^^^^
File "C:\Users\huang\AppData\Local\Programs\Python\Python312\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 576, in code_to_exec
exec(code, module.dict)
File "C:\Users\huang\Documents\GitHub\training\scripts\appsubmitter.py", line 120, in
unique_tags, unique_types, unique_licenses = get_unique_values_from_yamls(directory_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\appsubmitter.py", line 44, in get_unique_values_from_yamls
df = load_dataframe(resources_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 102, in load_dataframe
content = all_content(directory_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 92, in all_content
new_content = read_yaml_file(directory_path + filename)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\huang\Documents\GitHub\training\scripts\generate_link_lists.py", line 120, in read_yaml_file
with open(filename, 'r', encoding="utf8") as file:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '..\resourcesnfdi4bioimage.yml'

@SeverusYixin
Copy link
Collaborator Author

maybe with os.path.join()?

@haesleinhuepf
Copy link
Member

Did you try this?

@SeverusYixin
Copy link
Collaborator Author

no, because that's need to change the code in "generate_link_lists.py".

@haesleinhuepf
Copy link
Member

Changing files is a normal thing. Give it a try.

@SeverusYixin
Copy link
Collaborator Author

ok, that's more easy that I can update it 👍

@haesleinhuepf
Copy link
Member

Are there any news on this @SeverusYixin ?

@SeverusYixin
Copy link
Collaborator Author

Hi @haesleinhuepf, this one also finished.

@haesleinhuepf
Copy link
Member

True!
Done in #128

This issue was closed.
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

2 participants