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

Issue installing under conda #13

Open
djr2015 opened this issue Dec 19, 2024 · 4 comments
Open

Issue installing under conda #13

djr2015 opened this issue Dec 19, 2024 · 4 comments

Comments

@djr2015
Copy link

djr2015 commented Dec 19, 2024

Hello, I'm excited by this work and to get it running but am having issues doing so with conda.

How to reproduce:

# Create conda environment with python 3.10
conda create -n vseal python=3.10
# Activate conda environment
conda activate vseal

cd videoseal
pip install -e .

When running pip install -e . I get

Obtaining file:///home/djrob/videoseal
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Installing backend dependencies ... done
  Preparing editable metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing editable metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Traceback (most recent call last):
        File "/opt/conda/envs/vseal/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/conda/envs/vseal/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/conda/envs/vseal/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 181, in prepare_metadata_for_build_editable
          return hook(metadata_directory, config_settings)
        File "/var/tmp/pip-build-env-ta2s5cz4/overlay/lib/python3.10/site-packages/flit_core/buildapi.py", line 49, in prepare_metadata_for_build_wheel
          metadata = make_metadata(module, ini_info)
        File "/var/tmp/pip-build-env-ta2s5cz4/overlay/lib/python3.10/site-packages/flit_core/common.py", line 453, in make_metadata
          md_dict.update(get_info_from_module(module, ini_info.dynamic_metadata))
        File "/var/tmp/pip-build-env-ta2s5cz4/overlay/lib/python3.10/site-packages/flit_core/common.py", line 229, in get_info_from_module
          docstring, version = get_docstring_and_version_via_import(target)
        File "/var/tmp/pip-build-env-ta2s5cz4/overlay/lib/python3.10/site-packages/flit_core/common.py", line 202, in get_docstring_and_version_via_import
          spec.loader.exec_module(m)
        File "<frozen importlib._bootstrap_external>", line 883, in exec_module
        File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
        File "/home/djrob/videoseal/videoseal/__init__.py", line 9, in <module>
          from .utils.cfg import setup_model_from_model_card as load
        File "/home/djrob/videoseal/videoseal/utils/cfg.py", line 18, in <module>
          from videoseal.augmentation import get_validation_augs
      ModuleNotFoundError: No module named 'videoseal'
      [end of output]

I've also tried installing the pytorch related dependencies first, as well as doing this under a venv but get the same error in both cases.

@djr2015
Copy link
Author

djr2015 commented Dec 19, 2024

Edit: Seems like it might be the same issue as #8. I made sure I pulled the latest version of the repo but it doesn't fix things on my end.
I saw since #7 pip was preferred over conda but I still ran into issues with using pip on its own in a different environment.

@AreChen
Copy link

AreChen commented Dec 25, 2024

The same issue was tried on both Linux (Ubuntu) and Windows.

@AreChen
Copy link

AreChen commented Dec 26, 2024

Solved
You need to modify the following line in videoseal\models\extractor.py

from ..modules.convnext import ConvNeXtV2
from ..modules.hidden import HiddenDecoder
from ..modules.pixel_decoder import PixelDecoder
from ..modules.vit import ImageEncoderViT

You need to modify the following line in videoseal\utils\cfg.py

from ..augmentation import get_validation_augs
from ..augmentation.augmenter import get_dummy_augmenter
from ..data.datasets import (CocoImageIDWrapper, ImageFolder,
                                     VideoDataset)
from ..models import Videoseal, build_embedder, build_extractor, build_baseline
from ..modules.jnd import JND
from ..utils.data import Modalities, parse_dataset_params

You need to modify the following line in videoseal_init_.py

# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Videoseal Package

Videoseal is a package,write anything here.
"""
__version__ = "0.1"

from .utils.cfg import setup_model_from_model_card as load

Then pip install -e .

@xiaoyao9184
Copy link

I think the pyproject.toml file is meaningless for packages that are not published to PyPI.

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

3 participants