zc.buildout构建项目时报错‘AttributeError: '_NamespacePath' object has no attribute 'sort'’

在使用zc.buildout构建项目时如果碰到‘AttributeError: ‘_NamespacePath‘ object has no attribute ‘sort‘’报错:

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 2123, in main
    getattr(buildout, command)(args)
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 680, in install
    [self[part][‘recipe‘] for part in install_parts]
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 680, in <listcomp>
    [self[part][‘recipe‘] for part in install_parts]
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 1274, in __getitem__
    options._initialize()
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 1382, in _initialize
    self.initialize()
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 1388, in initialize
    recipe_class = _install_and_load(reqs, ‘zc.buildout‘, entry, buildout)
  File "c:\python36\lib\site-packages\zc\buildout\buildout.py", line 1338, in _install_and_load
    allow_hosts=buildout._allow_hosts
  File "c:\python36\lib\site-packages\zc\buildout\easy_install.py", line 920, in install
    return installer.install(specs, working_set)
  File "c:\python36\lib\site-packages\zc\buildout\easy_install.py", line 673, in install
    ws.add(dist)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 790, in add
    self._added_new(dist)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 990, in _added_new
    callback(dist)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 3047, in <lambda>
    add_activation_listener(lambda dist: dist.activate(replace=True), existing=False)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 2574, in activate
    fixup_namespace_packages(self.location)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 2162, in fixup_namespace_packages
    subpath = _handle_ns(package, path_item)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 2091, in _handle_ns
    _rebuild_mod_path(path, packageName, module)
  File "c:\python36\lib\site-packages\pkg_resources\__init__.py", line 2120, in _rebuild_mod_path
    orig_path.sort(key=position_in_sys_path)
AttributeError: ‘_NamespacePath‘ object has no attribute ‘sort‘

可以尝试升级一下setuptools来解决这个问题:

pip3 install --upgrade setuptools

 

zc.buildout构建项目时报错‘AttributeError: '_NamespacePath' object has no attribute 'sort'’

原文地址:https://www.cnblogs.com/loganblogs/p/8302000.html

时间: 2024-08-24 12:27:23

zc.buildout构建项目时报错‘AttributeError: '_NamespacePath' object has no attribute 'sort'’的相关文章

解决window7 x64位Anaconda启动报错:AttributeError: &#39;_NamespacePath&#39; object has no attribute &#39;sort&#39;

最近论文需要用到python做数据分析,python语法简单,但是Windows下安装第三方包恶心的要命,statsmodels用pip死活安装不上,网上查了说包相互依赖windows下的pip不能下载全,还有好几个其他的统计包也是如此,整晕了算. 看网上有些python大牛推荐Anaconda,可以解决包的问题,于是卸载本地的python,从官网上下了个Anconda玩玩,结果遇到新问题. 问题如下: An unexpected error has occurred. Please consi

facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: &#39;dict&#39; object has no attribute &#39;iteritems&#39;

报错原因:在进行facenet进行train_softmax.py训练时,在一轮训练结束进行验证时,报错AttributeError: 'dict' object has no attribute 'iteritems' 解决方案:由于我的python时3.5的,Python3.5中:iteritems变为items,找到train_softmax程序修改如下: facenet pyhton3.5 训练 train_softmax.py 时报错AttributeError: 'dict' obj

Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attribute 'xxx'".这其实是.pyc文件存在问题. 问题定位: 查看import库的源文件,发现源文件存在且没有错误,同时存在源文件的.pyc文件 问题解决方法: 1. 命名py脚本时,不要与python预留字,模块名等相同 2. 删除该库的.pyc文件(因为py脚本每次运行时均会生成.pyc文件

python-pip升级报错- AttributeError: &#39;NoneType&#39; object has no attribute &#39;bytes&#39;

正常的pip升级命令: python -m pip install --upgrade pip 在pytharm里面创建了一个Python项目,pytharm会自动搭建一个新的Python环境,在当前的目录下使用 python -m pip install --upgrade pip 会报错 AttributeError: 'NoneType' object has no attribute 'bytes' 可以使用如下方式 easy_install -U pip python-pip升级报错-

python jieba 结巴分词报错 AttributeError: &#39;module&#39; object has no attribute &#39;cut&#39;

首先这个AttributeError: ‘module’ object has no attribute ‘cut’ 报错的原因是因为有jieba.py这个文件存在,或者jieba这样命名的文件存在,很多新人使用结巴 来分词的时候命名直接为jieba.py,但是其实官方给的教程代码里有import jieba,这样就会引用到你自己这个教程文件jieba.py,而没有引用官方的库,这样自然cut这个方法就没有,所以报错.解决方法:1.不要使用jieba.py来命名你的测试文件.2.你一开始就是用j

Spring Boot 构建项目时报错:You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugi

You need to run build with JDK or have tools.jar on the classpath.If this occures during eclipse build make sure you run eclipse under JDK as well (com.mysema.maven:apt-maven-plugin:1.1.3:process:default:generate-sources) 1. 仔细的看看自己的电脑的环境变量有没有配置错误,我的

python 脚本运行时报错: AttributeError: &#39;module&#39; object has no attribute ***

最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attribute 'xxx'".这其实是.pyc文件存在问题. 问题定位: 查看import库的源文件,发现源文件存在且没有错误,同时存在源文件的.pyc文件 问题解决方法: 1. 命名py脚本时,不要与python预留字,模块名等相同 2. 删除该库的.pyc文件(因为py脚本每次运行时均会生成.pyc文件

Django项目与mysql交互进行数据迁移时报错:AttributeError: &#39;str&#39; object has no attribute &#39;decode&#39;

问题描述 Django项目启动,当我们执行命令 python manage.py makemigrations 出现如下错误: File "/usr/local/lib/python3.6/dist-packages/django/db/backends/mysql/operations.py", line 147, in last_executed_query query = query.decode(errors='replace') AttributeError: 'str' o

使用Eclipse自带的Maven插件创建Web项目时报错:

问题描述: 使用Eclipse自带的Maven插件创建Web项目时报错: Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:RELEASE from any of the configured repositories. Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:REL