程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

python load_entry_point

編輯:Python
1.apt install clustershell
2.you will have this file
/usr/bin/clush
content following
#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'ClusterShell==1.8.3','console_scripts','clush'
__requires__ = 'ClusterShell==1.8.3'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('ClusterShell==1.8.3', 'console_scripts', 'clush')()
)
3.run it with root user
[email protected]:/usr/lib/python3/dist-packages# /usr/bin/clush
Traceback (most recent call last):
File "/usr/bin/clush", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3254, in <module>
def _initialize_master_working_set():
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3237, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3266, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 584, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 901, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 787, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ClusterShell==1.8.3' distribution was not found and is required by the application
4.run it with normal user
[email protected]:~/stackaggregation$ /usr/bin/clush
/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 0.23ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py:122: PkgResourcesDeprecationWarning: 0.1.36ubuntu1 is an invalid version and will not be supported in a future release
warnings.warn(
Traceback (most recent call last):
File "/usr/bin/clush", line 6, in <module>
from pkg_resources import load_entry_point
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3247, in <module>
def _initialize_master_working_set():
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3221, in _call_aside
f(*args, **kwargs)
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 3259, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 579, in _build_master
ws.require(__requires__)
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 897, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/wk/.local/lib/python3.8/site-packages/pkg_resources/__init__.py", line 783, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'ClusterShell==1.8.3' distribution was not found and is required by the application
5.install clustershell in normal user
[email protected]:~/stackaggregation$ pip install clustershell==1.8.3
[email protected]:~/stackaggregation$ /usr/bin/clush
Usage: clush [options] command
clush: error: No node to run on.

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved