安装functools给我AttributeError'模块'对象没有属性'compose'

编程入门 行业动态 更新时间:2024-10-25 12:26:42
本文介绍了安装functools给我AttributeError'模块'对象没有属性'compose'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在新系统上安装了64位Ubuntu 12.04,但无法安装functools.我已经安装了多次,但不记得收到此错误,并且无法通过Google找到任何解决方案.我该怎么办?

I installed Ubuntu 12.04 64 bit on a new system, and cannot install functools. I have installed this multiple times but do not remember getting this error, and cannot find any solution through Google. What do I need to do?

(myvenv)bobs@myvenv:~$ pip install functools Downloading/unpacking functools Downloading functools-0.5.tar.gz Running setup.py egg_info for package functools Traceback (most recent call last): File "<string>", line 3, in <module> File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 2, in <module> from setuptools.extension import Extension, Library File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/extension.py", line 5, in <module> from setuptools.dist import _get_unpatched File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/dist.py", line 10, in <module> from setuptoolspat import numeric_types, basestring File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/compat.py", line 17, in <module> import httplib File "/usr/lib/python2.7/httplib.py", line 71, in <module> import socket File "/usr/lib/python2.7/socket.py", line 49, in <module> from functools import partial File "functools.py", line 72, in <module> globals()['c_%s' % x] = globals()[x] = getattr(_functools, x) AttributeError: 'module' object has no attribute 'compose' Complete output from command python setup.py egg_info: Traceback (most recent call last): File "<string>", line 3, in <module> File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/__init__.py", line 2, in <module> from setuptools.extension import Extension, Library File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/extension.py", line 5, in <module> from setuptools.dist import _get_unpatched File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/dist.py", line 10, in <module> from setuptoolspat import numeric_types, basestring File "/home/bobs/.virtualenvs/myvenv/local/lib/python2.7/site-packages/setuptools/compat.py", line 17, in <module> import httplib File "/usr/lib/python2.7/httplib.py", line 71, in <module> import socket File "/usr/lib/python2.7/socket.py", line 49, in <module> from functools import partial File "functools.py", line 72, in <module> globals()['c_%s' % x] = globals()[x] = getattr(_functools, x) AttributeError: 'module' object has no attribute 'compose' ---------------------------------------- Cleaning up... Command python setup.py egg_info failed with error code 1 in /home/bobs/.virtualenvs/myvenv/build/functools Storing complete log in /home/bobs/.pip/pip.log

推荐答案

Python2.7附带了functools模块.

Python2.7 comes with the functools module included.

如果要获取Python3.2引入的lru-cache装饰器,可以安装functools32.

You can install functools32 if you want to get the lru-cache decorator, which was introduced with Python3.2.

编辑:我实际上检查了此内容.当我尝试使用Python2.7点子安装functools时,出现了相同的错误.只需执行import functools并照常进行即可.

I actually checked this. I got the same error when I tried to pip-install functools with Python2.7. Simply do import functools and proceed as usual.

更多推荐

安装functools给我AttributeError'模块'对象没有属性'compose'

本文发布于:2023-07-05 07:04:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1034463.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:给我   模块   属性   对象   functools

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!