cyberb commented on 15 Apr

Traceback (most recent call last):
File "/snap/users/x1/python/bin/ldapcherryd", line 11, in <module>
load_entry_point('ldapcherry==1.1.1', 'console_scripts', 'ldapcherryd')()
File "/snap/users/x1/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/snap/users/x1/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
return ep.load()
File "/snap/users/x1/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2346, in load
return self.resolve()
File "/snap/users/x1/python/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2352, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/snap/users/x1/python/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/__init__.py", line 19, in <module>
from ldapcherry.exceptions import *
File "/snap/users/x1/python/lib/python2.7/site-packages/ldapcherry-1.1.1-py2.7.egg/ldapcherry/exceptions.py", line 9, in <module>
import cherrypy
File "/snap/users/x1/python/lib/python2.7/site-packages/CherryPy-17.4.1-py2.7.egg/cherrypy/__init__.py", line 66, in <module>
from ._cperror import (
File "/snap/users/x1/python/lib/python2.7/site-packages/CherryPy-17.4.1-py2.7.egg/cherrypy/_cperror.py", line 129, in <module>
from more_itertools import always_iterable
File "build/bdist.linux-x86_64/egg/more_itertools/__init__.py", line 1, in <module>
File "/snap/users/x1/python/lib/python2.7/site-packages/more_itertools-7.0.0-py2.7.egg/more_itertools/more.py", line 333
def _collate(*iterables, key=lambda a: a, reverse=False):
^
SyntaxError: invalid syntax

Maybe related to: https://stackoverflow.com/questions/54648246/invalid-syntax-in-more-itertools-when-running-pytest

I can confirm that requiring a more-itertools dependency that is less than 6.0.0 is required to fix this issue when using Python 2. There is a python3 branch to LdapCherry, and I don't know if the migration is going to be soon, or if the maintainer plans to maintain two versions.

 
 
 

vishwakumba commented on 30 Apr

I also obtained the same error while starting ldapcherry

[root@ldapcherry scripts]# ldapcherryd -c /etc/ldapcherry/ldapcherry.ini -D
Traceback (most recent call last):
File "/bin/ldapcherryd", line 9, in
load_entry_point('ldapcherry==1.1.1', 'console_scripts', 'ldapcherryd')()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/site-packages/ldapcherry/init.py", line 19, in
from ldapcherry.exceptions import *
File "/usr/lib/python2.7/site-packages/ldapcherry/exceptions.py", line 9, in
import cherrypy
File "/usr/lib/python2.7/site-packages/cherrypy/init.py", line 66, in
from ._cperror import (
File "/usr/lib/python2.7/site-packages/cherrypy/_cperror.py", line 129, in
from more_itertools import always_iterable
File "/usr/lib/python2.7/site-packages/more_itertools/init.py", line 1, in
from more_itertools.more import * # noqa
File "/usr/lib/python2.7/site-packages/more_itertools/more.py", line 333
def _collate(*iterables, key=lambda a: a, reverse=False):
^
SyntaxError: invalid syntax

 
 
 

vishwakumba

commented

on 30 Apr

 

The foll. workaround seems to resolve this issue: (CentOS 7.2/Python 2.7.5 and ldapcherry 1.1.1)

$ pip install 'more-itertools<=5.0.0'

 
 

Contributor

smacz42

commented

on 13 Jul

This is the correct fix. This issue should be marked as closed.

解决:File "/usr/lib/python2.7/site-packages/more_itertools/more.py", line 340 def _collate(*iterables, key=lambda a: a, reverse=False): 的报错的更多相关文章

  1. Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-4238-b658-ade407ff9456. Last exception: [u'Traceback (most recent call last):\n', u' File "/usr/lib/py

    Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 7d90eb80-29e2-42 ...

  2. /usr/lib/python2.7/subprocess.py", line 1239, in _execute_child

    Traceback (most recent call last):File "/home/eping/bin/repo", line 685, in main(sys.argv[ ...

  3. linux安装软件时/usr/lib/python2.7/site-packages/urlgrabber/grabber.py文件异常

    linux安装软件时,经常出现以下异常信息 Traceback (most recent call last): File , in <module> main() File , in m ...

  4. 安装python File "/usr/bin/pip", line 11, in <module> sys.exit(main()) File "/usr/lib/python3.4/site-packages/pip/__init__.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/u

      $ uname -a Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u6 (2015-11-09) x86_64 GNU ...

  5. /usr/lib/python2.7/site-packages/requests/__init__.py:91: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match a supported version!

    /usr/lib/python2.7/site-packages/requests/ __init__.py:91: RequestsDependencyWarning: urllib3(1.22)或 ...

  6. python3 安装scrapy Exception: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1006, in check_if_exists解决方法

    错误代码: Exception: Traceback (most recent call last): File , in check_if_exists self.satisfied_by = pk ...

  7. /usr/lib/python2.7/site-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.2.1) doesn't match a supported version! RequestsDependencyWarning)

    [root@iZwz9bhan5nqzh979qokrkZ ~]# ansible all -m ping /usr/lib/python2.7/site-packages/requests/__in ...

  8. Linux Python import jenkins 报错 oserror: /usr/lib/python2.7/site-packages/lookup3.so

    安装了jenkins和Python-jenkins后,在脚本中import jenkins会报错:oserror: /usr/lib/python2.7/site-packages/lookup3.s ...

  9. 【pip uninstall 无法卸载】Not uninstalling numpy at /usr/lib/python2.7/dist-packages, outside environment /usr

    想卸载python的库numpy,执行pip uninstall gunicorn,报错如下: Not uninstalling numpy at /usr/lib/python2.7/dist-pa ...

随机推荐

  1. OSI&TCP/IP模型

    OSI模型 OSI协议 基于OSI模型异构网络主机之间通信的协议 1. 应用层 不同的应用程序所在层,如邮件程序,web程序 2. 表示层 不同的文件类型如图片,视频等 3. 会话层 决定是否建立与其 ...

  2. php + h5 实现socket推送技术

    在socket出现之前已经有ajax定时请求.长轮询等方案,但都不能满足需求,socket就应用而生了. socket基本函数socket 总结下常用的socket函数 服务端: socket_cre ...

  3. 攻防世界高手进阶之Web_python_block_chain(2018年DDCTFmini blockchain)

    打开题目大概看了一下,是有关区块链的题目, 感觉代码要格式化一下,不然没法看 代码格式化站点:https://www.html.cn/tool/js_beautify/ hash of genesis ...

  4. 用BlockBoundQueue和c++11实现多线程生产者消费者问题

    // file : blockBoundQueue.h #ifndef YANG_BLOCKBOUNDQUEUE #define YANG_BLOCKBOUNDQUEUE #include <m ...

  5. “为了交项目干杯”对“那周余嘉熊掌将得队”、“男上加男,强人所男”的Beta产品测试报告

    "为了交项目干杯"对"那周余嘉熊掌将得队"."男上加男,强人所男"的Beta产品测试报告 格式描述 课程名称:软件工程1916|W(福州大学 ...

  6. reflow和repaint理解总结

    repaint就是重绘,reflow就是回流 严重性: 在性能优先的前提下,reflow的性能消耗要比repaint的大. 体现: repaint是某个dom元素进行重绘,reflow是整个页面进行重 ...

  7. web前端如何性能优化提高加载速度

    前端优化有以下几种途径: 一.减少HTTP请求数量和次数: 二.使用CDN: 三.添加Expires头: 四.压缩组件: 五.将样式表放在头部: 六.将脚本放在底部: 七.避免CSS表达式: 八.使用 ...

  8. Java逆变(Covariant)和协变(Contravariant)

    1. 定义 逆变和协变描述的经过类型变换后的类型之间的关系.假如A和B表示类型,f表示类型变换,A ≤B表示A是B的子类型,那么 如果A ≤B,f(A) ≤f(B),那么f是协变 如果A ≤B,f(B ...

  9. 2017EC Final L SOS——找规律&&博弈

    题意 有n个格子排成一行,两人轮流填,可填入"S"或"0",先得到"SOS"的人胜:如果全部填完也没有出现"SOS",则 ...

  10. 实现:创建/复制/移动文件API

    使用的API: 1.DeleteFile DeleteFileW( _In_ LPCWSTR lpFileName ); 2.CopyFile CopyFileW( _In_ LPCWSTR lpEx ...