-
-
Notifications
You must be signed in to change notification settings - Fork 809
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
"tgcf-web" command gives this error on Mac #594
Comments
I am also facing the same issue on Mac. |
@aahnik @nmaiti @MobCode100 @FloPinguin @Matt3oV , I guess most of the mac users are facing the same issue, please look into the matter as soon as possible. |
Same here, python3.12, neither downloaded .pkg, nor brew installed works |
In the same boat over here. Any help would be greatly appreciated! |
same here: mac m1, windows 10. both have python 3.12 |
please use docker based deployments, for compatibility issues |
I'm not a python programmer! These changes are temporary, and the explanations below are generated by ChatGPT to save time. Here's a step-by-step explanation: 1. Install vim and streamlit:First, I installed vim, a text editor for editing Python files, and then installed the specific version of streamlit that I needed: apt install vim
pip3 install streamlit==1.32 2. Get the location of the tgcf package:To find out where the tgcf package is installed in the Python environment, I ran the following command: pip3 show tgcf This command provides detailed information about the tgcf package, including its installation path. Here's an example of the output you might see:
The Location line shows the directory where tgcf is installed. You'll need this path to navigate to the web_ui directory in the next steps. 3. Navigate to the tgcf package directory:After finding the tgcf package location, I navigated to the tgcf directory inside the virtual environment: cd /home/.venv/lib/python3.12/site-packages/tgcf
cd web_ui 4. Edit run.py:I opened the run.py file inside the web_ui folder using vim to make the necessary changes: vim run.py 4. Import tgcf:Inside the run.py file, I added the following import at the top of the script to make the tgcf package accessible: import tgcf as tg 5. Fix the resources.path line:In the original code, there was an issue with accessing the package directory using resources.path. I changed this line: package_dir = resources.path(package=tg, resource="").__enter__() to a safer version that works by using a str() conversion. This is because resources.path returns a context manager, which needs to be handled properly. The updated line looks like this: package_dir = str(package_dir) + "/web_ui" This modification correctly defines the path to the web_ui directory within the tgcf package, which ensures everything works as expected. |
Traceback (most recent call last):
File "/Users/manjulsigdel/Projects/my-tgcf/.venv/bin/tgcf-web", line 8, in
sys.exit(main())
^^^^^^
File "/Users/manjulsigdel/Projects/my-tgcf/.venv/lib/python3.12/site-packages/tgcf/web_ui/run.py", line 8, in main
package_dir = resources.path(package=wu, resource="").enter()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 25, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/_legacy.py", line 120, in path
return _common.as_file(_common.files(package) / normalize_path(resource))
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 133, in truediv
return self.joinpath(child)
^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/readers.py", line 92, in joinpath
return super().joinpath(*descendants)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.12/3.12.3/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/resources/abc.py", line 117, in joinpath
target = next(names)
^^^^^^^^^^^
StopIteration
How to reproduce
Just installed following Readme
python version 3.12.3
pip version 24.0
Macbook Air M1 Chip
The text was updated successfully, but these errors were encountered: