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

after using pyinstaller, from-root does not work #2

Open
damnmso opened this issue May 23, 2023 · 1 comment
Open

after using pyinstaller, from-root does not work #2

damnmso opened this issue May 23, 2023 · 1 comment

Comments

@damnmso
Copy link

damnmso commented May 23, 2023

when using pyinstaller, from-root seems to be not able to find the .project_root

FileNotFoundError: No possible anchors found (.git, .project-root), cannot detect root folder. Initialize a git repository or create an empty ".project-root" file in the project root

PS C:\Users\xx.xx\Desktop\app> .\app.exe
WORKING IN: C:\Users\xx.xx\Desktop\app
Traceback (most recent call last):
  File "app.py", line 11, in <module>
  File "adapters\gui\gui_app.py", line 15, in run
  File "applicationconfiguration.py", line 14, in getBusinessObject
  File "business\credfilehelper.py", line 10, in createCredFileIfNotExists
  File "from_root\root.py", line 24, in from_root
  File "from_root\get_project_root.py", line 23, in get_project_root
FileNotFoundError: No possible anchors found (.git, .project-root), cannot detect root folder. Initialize a git repository or create an empty ".project-root" file in the project root
[2192] Failed to execute script 'app' due to unhandled exception!
PS C:\Users\xx.xx\Desktop\app> ls .\.project_root


    Verzeichnis: C:\Users\xx.xx\Desktop\app


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        23.05.2023     09:07             27 .project_root

this was from powershells command line, so even if the path should be correct, seems like its not
i added a print os.getcwd() just to be sure

@EduardKononov
Copy link
Owner

EduardKononov commented May 23, 2023

This is what I get on MacOS:

(base) ekon@mb-pro issue % cat __main__.py
from from_root import from_root

print(from_root())

(base) ekon@mb-pro issue % ./__main__    # this is a pyinstalled __main__.py
Traceback (most recent call last):
  File "proj/__main__.py", line 3, in <module>
  File "from_root/root.py", line 24, in from_root
  File "from_root/get_project_root.py", line 23, in get_project_root
FileNotFoundError: No possible anchors found (.git, .project-root), cannot detect root folder. Initialize a git repository or create an empty ".project-root" file in the project root
[90869] Failed to execute script '__main__' due to unhandled exception!

(base) ekon@mb-pro issue % touch .project-root

(base) ekon@mb-pro issue % ./__main__
/Users/ekon/Desktop/issue

It might be something Windows specific. Don't have a win pc now. Feel free to contribute, if you wish :)

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