mxin262 / SwinTextSpotter

Pytorch re-implementation of Paper: SwinTextSpotter: Scene Text Spotting via Better Synergy between Text Detection and Text Recognition (CVPR 2022)
275 stars 42 forks source link

关于setup.py的疑问 #110

Open Kelsey-Zhao opened 1 year ago

Kelsey-Zhao commented 1 year ago

您好,执行python setup.py build develop过程中出现如下报错,要如何解决?谢谢!

Traceback (most recent call last): File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/init.py", line 3109, in _dep_map return self.dep_map File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/init.py", line 2902, in getattr__ raise AttributeError(attr) AttributeError: _DistInfoDistribution__dep_map

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 35, in init parsed = _parse_requirement(requirement_string) File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 64, in parse_requirement return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES)) File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 82, in _parse_requirement url, specifier, marker = _parse_requirement_details(tokenizer) File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 120, in _parse_requirement_details specifier = _parse_specifier(tokenizer) File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 216, in _parse_specifier parsed_specifiers = _parse_version_many(tokenizer) File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_parser.py", line 231, in _parse_version_many tokenizer.raise_syntax_error( File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/_tokenizer.py", line 165, in raise_syntax_error raise ParserSyntaxError( pkg_resources.extern.packaging._tokenizer.ParserSyntaxError: . suffix can only be used with == or != operators PyYAML (>=5.1.)



The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "setup.py", line 189, in <module>
    setup(
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/develop.py", line 126, in install_for_development
    self.process_distribution(None, self.dist, not self.no_deps)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 750, in process_distribution
    distros = WorkingSet([]).resolve(
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 829, in resolve
    dist = self._resolve_dist(
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 865, in _resolve_dist
    dist = best[req.key] = env.best_match(
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1135, in best_match
    return self.obtain(req, installer)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1147, in obtain
    return installer(requirement)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 677, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 703, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 861, in install_eggs
    return [install_dist(dist_filename, tmpdir)]
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 1078, in install_wheel
    self.execute(
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/cmd.py", line 339, in execute
    util.execute(func, args, msg, dry_run=self.dry_run)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/_distutils/util.py", line 337, in execute
    func(*args)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/wheel.py", line 117, in install_as_egg
    self._install_as_egg(destination_eggdir, zf)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/wheel.py", line 125, in _install_as_egg
    self._convert_metadata(zf, destination_eggdir, dist_info, egg_info)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/setuptools/wheel.py", line 162, in _convert_metadata
    install_requires = list(map(raw_req, dist.requires()))
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2822, in requires
    dm = self._dep_map
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3111, in _dep_map
    self.__dep_map = self._compute_dependencies()
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3121, in _compute_dependencies
    reqs.extend(parse_requirements(req))
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3174, in __init__
    super(Requirement, self).__init__(requirement_string)
  File "/home/zyq/anaconda3/envs/SWINTS/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 37, in __init__
    raise InvalidRequirement(str(e)) from e
pkg_resources.extern.packaging.requirements.InvalidRequirement: .* suffix can only be used with `==` or `!=` operators
    PyYAML (>=5.1.*)
            ~~~~~~^
Kelsey-Zhao commented 1 year ago

build可顺利运行,但develop阶段就会出现上述问题。 现已基本解决。放弃develop,在执行训练和测试指令时根据报错自行安装缺少的库即可。

mxin262 commented 1 year ago

看上去应该是一些版本兼容的问题