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

How sam2_configs pushed in the {sys.path} in python? #160

Closed
aza1200 opened this issue Aug 6, 2024 · 1 comment
Closed

How sam2_configs pushed in the {sys.path} in python? #160

aza1200 opened this issue Aug 6, 2024 · 1 comment

Comments

@aza1200
Copy link

aza1200 commented Aug 6, 2024

By the segment-anything-2/INSTALL.md's comment

It says that


I got `MissingConfigException: Cannot find primary config 'sam2_hiera_l.yaml'`

This is usually because you haven't run the pip install -e . step above, so sam2_configs isn't in your Python's sys.path. Please run this installation step. In case it still fails after the installation step, you may try manually adding the root of this repo to PYTHONPATH via

export SAM2_REPO_ROOT=/path/to/segment-anything  # path to this repo
export PYTHONPATH="${SAM2_REPO_ROOT}:${PYTHONPATH}"

to manually add sam2_configs into your Python's sys.path.


But I can't find out
how sam2_configs are inserted by executing

pip install -e .

I know that acting means python setup.py
But in that file there is no indication that insert python.syspath

@ronghanghu
Copy link
Contributor

ronghanghu commented Aug 6, 2024

Hi @aza1200, do you encounter any failures after pip install -e . (or manually adding the repo root to PYTHONPATH) as in https://github.com/facebookresearch/segment-anything-2/blob/main/INSTALL.md?

Please reopen or create a new issue if you encounter failures with this step.


I know that acting means python setup.py
But in that file there is no indication that insert python.syspath

Regarding pip install -e ., it would usually create a link to the SAM 2 repo path (in my environment, it adds a link in my Anaconda environment at
~/anaconda3/envs/base/lib/python3.10/site-packages/__editable__.SAM_2-1.0.pth) to allow editable installations. See details in https://setuptools.pypa.io/en/latest/userguide/development_mode.html and pypa/setuptools#3548.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants