-
Notifications
You must be signed in to change notification settings - Fork 2k
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
gpt-researcher as python module - messy file structure when installed in environment? #766
Comments
The paths shown are correct for the RECORD file, which lists all the files installed by the package. The fact that the files are not fully qualified paths is normal; Python uses these relative paths within the package directory. |
in my env these files are actually installed on the library root level, e.g. |
This is something I'm a little concerned about as well when I was looking through the examples. I think it would be better for the backend to be qualified by gpt_researcher and not outside of it to limit potential clashes of another package named "backend". |
@assafelovic Is this intentional ? potentially backend might conflict with other packages. If this was not intentional, I would like to take this up and fix. |
Hey @poornagurram gpt_researcher is a pip package and is leveraged within the backend service. You can check it out for examples: https://docs.gptr.dev/docs/gpt-researcher/getting-started/how-to-choose lmk if you have any improvement suggestions |
I see. We may need to change the overall structure or probably name the backend as gptr-backend and multi_agents as gptr-multiagents. Please find below the conflict which is arising with the current structure. @assafelovic I quickly tried importing backend and multi-agent with gpt-researcher and without the same. GPTR Installed
works(not expected). This might conflict if someone has their own folders with these names. Expected behaviour with GPTR Installed
GPTR Uninstalled
doesn't work. (expected) Let me know what you think! |
I'm still a bit confused. The naming conflicts with existing directories? That's the main issue? |
Apologies for the confusion caused. Yes, that's the issue. |
Hey @assafelovic, basically everything related to gpt-researcher, except for external dependencies should ideally be encapsulated within gpt-researcher because you can end up in a situation where a similar named package to backend clashes with the backend module of gpt-researcher. For example, I created a new environment. If I ls the site packages folder, we'll get the following:
Then I install gpt-researcher:
After installing gpt-researcher, the site-packages becomes:
The main modules of the gpt-researcher python package are the two highlighted above in bold:
If I then ls the backend folder, we have the following files:
But if someone else installs a package named backend, If we then ls the backend folder, we'll get the following:
Installing the package backend will overwrite any similarly named files with those of the installing package. For example, before I installed the package named backend, the __init__.py contained, Ideally, everything related to the gpt-researcher package, should be qualified by the package name as is the case with packages typically installed via pip before such as
Whilst it's probably unlikely for someone to install gpt-research and a package named backend, it is a potential case of failure in the future if someone does. |
I installed the package into my environment:
on inspection, something seems off:
(gpt-researcher-3.12.4) ➜ gpt_researcher-0.8.7.dist-info cat RECORD
yields lines like:
To me that looks like package files are installed in
site-packages
instead of thesite-packages\gpt-researcher
subdirectory.The text was updated successfully, but these errors were encountered: