Re: Docker Compose missing dependancy?
Posted: 21 Oct 2022, 20:46
After do the steps mentioned
docker-compose --version
Traceback (most recent call last):
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 800, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (docker-compose 1.29.2 (/Volume1/@apps/Python3/lib/python3.10/site-packages), Requirement.parse('docker-compose==1.24.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 6, in <module>
from pkg_resources import load_entry_point
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3260, in <module>
def _initialize_master_working_set():
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 583, in _build_master
return cls._build_from_requirements(__requires__)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 596, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'docker-compose==1.24.1' distribution was not found and is required by the application
and even installing the "correct" verison with ./pip install docker-compose==1.24.1
It doesnt work
docker-compose up -d
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.24.1', 'console_scripts', 'docker-compose')()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/main.py", line 71, in main
command()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/main.py", line 124, in perform_command
project = project_from_options('.', options)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/command.py", line 33, in project_from_options
return get_project(
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/command.py", line 111, in get_project
config_details = config.find(project_dir, config_path, environment, override_dir)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 291, in find
[ConfigFile.from_filename(f) for f in filenames],
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 291, in <listcomp>
[ConfigFile.from_filename(f) for f in filenames],
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 191, in from_filename
return cls(filename, load_yaml(filename))
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 1493, in load_yaml
return yaml.safe_load(fh)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/__init__.py", line 94, in safe_load
return load(stream, SafeLoader)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/__init__.py", line 72, in load
return loader.get_single_data()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 37, in get_single_data
return self.construct_document(node)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 46, in construct_document
for dummy in generator:
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
value = self.construct_mapping(node)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 204, in construct_mapping
return super().construct_mapping(node, deep=deep)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 126, in construct_mapping
if not isinstance(key, collections.Hashable):
AttributeError: module 'collections' has no attribute 'Hashable'
I revert back as mentioned
python -> /Volume1/@apps/Python3/sysroot/usr/bin/python
the python default to python2.7
cd /usr/bin/
unlink python
ln -s python2.7 python
docker-compose installed location
whereis docker-compose
docker-compose: /usr/bin/docker-compose /Volume1/@apps/docker/dockerd/bin/docker-compose
maybe this need to be changed
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'docker-compose==1.24.1','console_scripts','docker-compose'
import re
import sys
# for compatibility with easy_install; see #2198
__requires__ = 'docker-compose==1.24.1'
try:
from importlib.metadata import distribution
except ImportError:
try:
from importlib_metadata import distribution
except ImportError:
from pkg_resources import load_entry_point
def importlib_load_entry_point(spec, group, name):
dist_name, _, _ = spec.partition('==')
matches = (
entry_point
for entry_point in distribution(dist_name).entry_points
if entry_point.group == group and entry_point.name == name
)
return next(matches).load()
globals().setdefault('load_entry_point', importlib_load_entry_point)
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(load_entry_point('docker-compose==1.24.1', 'console_scripts', 'docker-compose')())
Let me know if you need something more ...
Thanks
docker-compose --version
Traceback (most recent call last):
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 581, in _build_master
ws.require(__requires__)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 909, in require
needed = self.resolve(parse_requirements(requirements))
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 800, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (docker-compose 1.29.2 (/Volume1/@apps/Python3/lib/python3.10/site-packages), Requirement.parse('docker-compose==1.24.1'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 6, in <module>
from pkg_resources import load_entry_point
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3260, in <module>
def _initialize_master_working_set():
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3234, in _call_aside
f(*args, **kwargs)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 3272, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 583, in _build_master
return cls._build_from_requirements(__requires__)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 596, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/setuptools-63.2.0-py3.10.egg/pkg_resources/__init__.py", line 795, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'docker-compose==1.24.1' distribution was not found and is required by the application
and even installing the "correct" verison with ./pip install docker-compose==1.24.1
It doesnt work
docker-compose up -d
Traceback (most recent call last):
File "/usr/bin/docker-compose", line 11, in <module>
load_entry_point('docker-compose==1.24.1', 'console_scripts', 'docker-compose')()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/main.py", line 71, in main
command()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/main.py", line 124, in perform_command
project = project_from_options('.', options)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/command.py", line 33, in project_from_options
return get_project(
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/cli/command.py", line 111, in get_project
config_details = config.find(project_dir, config_path, environment, override_dir)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 291, in find
[ConfigFile.from_filename(f) for f in filenames],
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 291, in <listcomp>
[ConfigFile.from_filename(f) for f in filenames],
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 191, in from_filename
return cls(filename, load_yaml(filename))
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/compose/config/config.py", line 1493, in load_yaml
return yaml.safe_load(fh)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/__init__.py", line 94, in safe_load
return load(stream, SafeLoader)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/__init__.py", line 72, in load
return loader.get_single_data()
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 37, in get_single_data
return self.construct_document(node)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 46, in construct_document
for dummy in generator:
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 398, in construct_yaml_map
value = self.construct_mapping(node)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 204, in construct_mapping
return super().construct_mapping(node, deep=deep)
File "/Volume1/@apps/Python3/sysroot/usr/lib/python3.10/site-packages/yaml/constructor.py", line 126, in construct_mapping
if not isinstance(key, collections.Hashable):
AttributeError: module 'collections' has no attribute 'Hashable'
I revert back as mentioned
python -> /Volume1/@apps/Python3/sysroot/usr/bin/python
the python default to python2.7
cd /usr/bin/
unlink python
ln -s python2.7 python
docker-compose installed location
whereis docker-compose
docker-compose: /usr/bin/docker-compose /Volume1/@apps/docker/dockerd/bin/docker-compose
maybe this need to be changed
#!/usr/bin/python
# EASY-INSTALL-ENTRY-SCRIPT: 'docker-compose==1.24.1','console_scripts','docker-compose'
import re
import sys
# for compatibility with easy_install; see #2198
__requires__ = 'docker-compose==1.24.1'
try:
from importlib.metadata import distribution
except ImportError:
try:
from importlib_metadata import distribution
except ImportError:
from pkg_resources import load_entry_point
def importlib_load_entry_point(spec, group, name):
dist_name, _, _ = spec.partition('==')
matches = (
entry_point
for entry_point in distribution(dist_name).entry_points
if entry_point.group == group and entry_point.name == name
)
return next(matches).load()
globals().setdefault('load_entry_point', importlib_load_entry_point)
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(load_entry_point('docker-compose==1.24.1', 'console_scripts', 'docker-compose')())
Let me know if you need something more ...
Thanks