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. windows自动化-脚本案例

    ; Script Start - Add your code below here Run("D:\Navicat Premium\navicat.exe") Sleep(1000 ...

  2. RedHat 6 安装 MySQL 5.5 流程记录及相关问题解决方案

    目录 1. RedHat 中 使用 yum 方式安装 MySQL 2. 安装过程中遇到的问题 1. RedHat 中 使用 yum 方式安装 MySQL 1.1 删除系统自带的 MySQL 5.1 r ...

  3. tp5 模型中配置数据库连接信息

    namespace app\api\model; use think\Model; class BaseModel extends Model { protected $connection = [ ...

  4. 分享一个批量修改文件编码的python脚本

    分享一个自己编写的递归查找子目录,将所有cpp文件编码修改为utf-8编码格式的小脚本 #i!/usr/bin/env python3 # -*- coding:utf-8 -*- import os ...

  5. SRVCC B1,B2事件总结

    何为SRVCC? SRVCC(Single Radio Voice Call Continuity)是3GPP提出的一种VoLTE语音业务连续性方案,主要是为了解决当单射频UE 在LTE网络和2G/3 ...

  6. urdf 学习记录

    1.URDF(Unified Robot Description Format),统一的机器人描述文件格式.主要用来描述机器人的几何形状,在可视化时(如RViz中)显示出机器人的几何形状.与画图软件( ...

  7. python中的特殊注释#todo与#type

    0904自我总结 python中的特殊注释 一.#TODO 这个注释用来快熟找到内容 #todo这里的todo不用区分大小写 写法标记的位置,#todo 备注内容 二.#type a = 1 #typ ...

  8. sql 查询哪些字段重复及(in和exict的区别)

    select count(1),content_id,keyword_id from tb_content_keyword_relation group by content_id,keyword_i ...

  9. Chomp类游戏——必胜策略分析

    首先介绍一个重要定理——策梅洛定理(Zermelo) 策梅洛定理,表明在二人参与的游戏/博弈中,如果满足: --------游戏的步骤数有限 --------信息完备(二人都了解游戏规则,了解游戏曾经 ...

  10. php面试题收藏

    总结几个要素: 1.个人简介名字大写,内容需要详实,一是可以给人留下映像,二是减少不必要的与面试官交换个人信息的时间.准备一份好的口头自我介绍是很有必要的,毕竟准备一次能用很久,时间花在上面很实用,面 ...