Closed Beterng closed 4 months ago
Has fix the torch issue so update the bug info
Facing the same.
This issue is connected with https://github.com/SociallyIneptWeeb/AICoverGen/issues/133#issue-2372232845 ploblem
@Beterng , the best way is, to install without version specifications, as it would by default install the latest versions of all the libraries. And if there are cases, when the package itself is not updated by the org to match the latter versions, then in that case, unfortunately, we need to install it accordingly.
I have the same problem.
pip install fairseq
fails due to invalid metadata for PyYAML dependency in omegaconf
Environment:
streamspeech
Steps to Reproduce:
Create and activate conda environment:
conda create -n streamspeech python=3.10 -y
conda activate streamspeech
Install dependencies:
conda install pytorch=2.0.1 torchvision torchaudio cudatoolkit=11.7 -c pytorch
sudo apt-get update
sudo apt-get install -y build-essential python3-dev
pip install cython numpy
pip install --upgrade pip setuptools
pip install PyYAML
Check PyYAML version:
python -c "import yaml; print(yaml.__version__)"
# Output: 6.0.1
Try to install fairseq
:
pip install --editable ./ --no-build-isolation
Observed Behavior:
The installation process fails with the following errors:
WARNING: Error parsing dependencies of omegaconf: .* suffix can only be used with `==` or `!=` operators
PyYAML (>=5.1.*)
~~~~~~^
ERROR: Exception:
Traceback (most recent call last):
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3070, in _dep_map
return self.__dep_map
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2863, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 36, in __init__
parsed = _parse_requirement(requirement_string)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 62, in parse_requirement
return _parse_requirement(Tokenizer(source, rules=DEFAULT_RULES))
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 80, in _parse_requirement
url, specifier, marker = _parse_requirement_details(tokenizer)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 118, in _parse_requirement_details
specifier = _parse_specifier(tokenizer)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 214, in _parse_specifier
parsed_specifiers = _parse_version_many(tokenizer)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_parser.py", line 229, in _parse_version_many
tokenizer.raise_syntax_error(
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/_tokenizer.py", line 167, in raise_syntax_error
raise ParserSyntaxError(
pip._vendor.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 "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/cli/base_command.py", line 179, in exc_logging_wrapper
status = run_func(*args)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/cli/req_command.py", line 67, in wrapper
return func(self, options, args)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/commands/install.py", line 377, in run
requirement_set = resolver.resolve(
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 427, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 247, in get_dependencies
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py", line 247, in <listcomp>
return [r for r in candidate.iter_dependencies(with_requires) if r is not None]
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 401, in iter_dependencies
for r in self.dist.iter_dependencies():
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py", line 247, in iter_dependencies
return self._dist.requires(extras)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2786, in requires
dm = self._dep_map
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3072, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3082, in _compute_dependencies
reqs.extend(parse_requirements(req))
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py", line 3135, in __init__
super().__init__(requirement_string)
File "/root/exit/envs/streamspeech/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py", line 38, in __init__
raise InvalidRequirement(str(e)) from e
pip._vendor.packaging.requirements.InvalidRequirement: .* suffix can only be used with `==` or `!=` operators
PyYAML (>=5.1.*)
~~~~~~^
Expected Behavior:
fairseq
should be installed without errors.
Additional Information:
Notes:
PyYAML
dependency in omegaconf
has an invalid metadata format that causes the error.Steps Tried:
pip
, setuptools
, and wheel
.PyYAML
and omegaconf
.Request for Help: I need assistance in resolving this installation failure. Any guidance or solutions would be appreciated.
Contact Information: 599153574@qq.com
@Gan-Xing , The issue seems to stem from an invalid version specifier in the omegaconf
package's metadata.
try out these steps, and let me know if it works,
Create a patched version of omegaconf by:-
Download the omegaconf
source code.
git clone https://github.com/omry/omegaconf.git
cd omegaconf
edit the setup.py
or setup.cfg
file to correct the version specifier for PyYAML.
Open the setup.cfg file (or setup.py if there is no setup.cfg) and change the PyYAML requirement from PyYAML (>=5.1.*) to PyYAML (>=5.1).
Install the above patch version before the fairseq
python setup.py sdist
pip install dist/omegaconf-<version>.tar.gz
Proceed with installing fairseq:
pip install --editable ./ --no-build-isolation
let me know, if it works
@Siddharth-Latthe-07 I don't see PyYAML version lines in the 2 setup.*
files.
@Geremia sorry my bad, not in setup. files in the requirements/base.txt
file, Change the version specifier from PyYAML (>=5.1.) to PyYAML (>=5.1).
and then proceed with above steps to install fairseq:- pip install fairseq
@Siddharth-Latthe-07 It builds omegaconf 2.4.0.dev3, and I still get the same issue installing fairseq
:
ERROR: Cannot install fairseq and fairseq==0.12.2 because these package versions have conflicting dependencies.
The conflict is caused by:
fairseq 0.12.2 depends on omegaconf<2.1
hydra-core 1.0.7 depends on omegaconf<2.1 and >=2.0.5
I don't know why it keeps Downloading omegaconf-2.0.5-py3-none-any.whl.metadata
.
@Siddharth-Latthe-07 I had to git checkout v2.0.6
first. That fixed the problem.
@Geremia so, the issue seems to have caused due version control, switching to relevant version of git helped to solve the dependency conflicts ig.
The problem may start with the pip version. I have downgraded to ver 20 and then it works. Issue close.
Great downgraded pip to version 20 and now nothing works anymore. Everything haywire. Will rebuild the venv.
The issue is not solved, downgrading the package manager is only a temporary hack. This isn't a pip bug.
来信已收到。谢谢。——此为自动回复。Votre courrier est bien re?0?4u,merci.//C'est une réponse automatique.Your e-mail has been received,thanks.//This is an automatic reply.
I downgraded my pip to 24.0 and now the pip install --editable
command ran smoothly!
Somebody else mentioned downgrading to 20, but that only caused other problems for me.
I downgraded my pip to 24.0 and now the
pip install --editable
command ran smoothly! Somebody else mentioned downgrading to 20, but that only caused other problems for me.
same here,
pip install pip == 24
after that fairseq downloaded fine
Can confirm - downgrading pip from 24.2 to 24.0 solved it for me. Fresh conda venv with Python 3.10.
It works for me too, thx!
Downgrading doesn't work at all. Tried pip 19, 24.0, 24.1
Downgraded to pip 20
The problem may start with the pip version. I have downgraded to ver 20 and then it works. Issue close.
ImportError: cannot import name 'SourceDistribution' from 'pip._internal.distributions.source'
I downgraded my pip to 24.0 and now the
pip install --editable
command ran smoothly! Somebody else mentioned downgrading to 20, but that only caused other problems for me.same here,
pip install pip == 24
after that fairseq downloaded fine
It works for me!
🐛 Bug
Environment
pip
, source): using pip but complie with vscode 2022 ( CMake Tools ).i use ther command to install
There is a full log
Something went wrong when install.