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. memcpy函数的实现

    1.按1个字节拷贝 (1)不要直接使用形参,要转换成char* (2)目标地址要实现保存 (3)要考虑源和目标内存重叠的情况 void * mymemcpy(void *dest, const voi ...

  2. springboot使用阿里fastjson来解析数据

    1.spring boot默认使用的json解析框架是jackson,使用fastjson需要配置,首先引入fastjson依赖 pom.xml配置如下: <project xmlns=&quo ...

  3. Fiddler抓包工具简介

    1.Fiddler工具: 个人认为Fiddler实际上是一款在浏览器与服务器之间设置代理,对两者之间的通信会话(数据包)进行抓取和处理的一款工具: Fiddler是一个http协议调试代理工具,它能够 ...

  4. 【Spring Cloud】Spring Cloud之整合Spring Cloud Bus以及最佳实践

    一.整合步骤 1)加入Maven坐标 <!-- actuator监控模块 --> <dependency> <groupId>org.springframework ...

  5. 详解Spring缓存注解@Cacheable,@CachePut , @CacheEvict使用

    https://blog.csdn.net/u012240455/article/details/80844361 注释介绍 @Cacheable @Cacheable 的作用 主要针对方法配置,能够 ...

  6. 设计模式--Proxy模式

    这篇主要介绍代理模式相关内容,主要是一些基本概念普及. 代理模式 1.什么是代理模式? 代理模式(Proxy),为其他对象提供一种代理以控制对这个对象的访问.[DP] 通俗的说就是指客户端并不直接调用 ...

  7. 计算机 KB,MB,GB,TB,PB,EB 计算

    ASCII码:一个英文字母(不分大小写)占一个字节的空间.一个二进制数字序列,在计算机中作为一个数字单元,一般为8位二进制数.换算为十进制,最小值-128,最大值127.如一个ASCII码就是一个字节 ...

  8. 伪分布式下Hadoop3.0打不开localhost:50070

    伪分布式下Hadoop打不开localhost:50070,可以打开localhost:8088 1.对hdfs进行format hadoop namenode -format 在选择Y/N时输入大写 ...

  9. 软件工程1916|W(福州大学)_助教博客】助教总结

    2018年上个学期,我担任计算机专业软件工程实践课程的助教,因为有汪老师和她的两位优秀研究生担任助教,基本上没有让我做什么事,除了参加了几次课程答辩.我对于助教需要做的事情其实还是没什么概念的.这个学 ...

  10. jdk1.8——jvm分析与调优

    很多文章都是讲如何配置JVM各个参数的,但是生产环境里参数的值到底配置为多少,却没有一个具体的指标.文章分四个部分,分别是JVM说明.配置,GC的过程和具体配置值. 一.JVM空间说明 JDK 1.7 ...