pip install wechatpy报错

安装python 版WeChat sdk

pip install wechatpy[cryptography]

报错

Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: ‘/var/folders/k2/x01hrj4552l0746g8fxdk5400000gn/T/pip-0E52Fq-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info‘

在用pip install安装python的一些包的时候遇到这个错误是因为这些包需要依赖six,在安装six的时候发现系统已经有一个six-1.4.1但又没有权限卸载它,所以无法安装新版本。six-1.4.1是系统内置的packages,因 系统集成保护 你是没有权限去修改/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info目录的。

解决方法是安装这些包时选择忽略six的安装:

sudo pip install wechatpy[cryptography] --upgrade --ignore-installed six

之后发现还是报错

Installing collected packages: six, python-dateutil, xmltodict, enum34, optionaldict, idna, urllib3, certifi, chardet, requests, pycparser, cffi, asn1crypto, ipaddress, cryptography, wechatpy
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, ‘wb‘) as fdst:
IOError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/six.py‘

权限问题,尝试

sudo pip install wechatpy[cryptography] --upgrade --ignore-installed six

参考文档:

http://wechatpy.readthedocs.io/zh_CN/master/install.html

http://www.cnblogs.com/chxw2017/p/6837100.html

http://blog.csdn.net/alanzjl/article/details/46849307

时间: 2024-09-27 16:56:20

pip install wechatpy报错的相关文章

pip install flask-mongoengine报错

pip install flask-mongoengine报错 报错如下: Collecting pytz (from -r /srv/wms/engine/requirements.txt (line 5)) Downloading https://pypi.doubanio.com/packages/a3/7f/e7d1acbd433b929168a4fb4182a2ff3c33653717195a26c1de099ad1ef29/pytz-2017.3-py2.py3-none-any.w

docker中pip install/uninstall报错

docker中pip install or uninstall报错 事件起因 今天开发同学咨询了一个问题,他说在docker的一个运行容器中执行如下命令: cd /usr/lib/python2.7/site-packages/ 该目录下有两个目录,分别是:smart_open 和 samrt_open-1.5.5-py2.7.egg-info rm -rf samrt_open-1.5.5-py2.7.egg-info/ 这时出现报错,报错信息如下: rm: cannot remove 'sm

pip install mysqlclient报错(OSError: mysql_config not found)

报错截图 一般情况是系统没有安装libmysqld-dev 执行 sudo apt install libmysqld-dev完成安装后再 pip install mysqlclient就可以了(系统环境Ubuntu18.04) 原文地址:https://www.cnblogs.com/IT-Crowd/p/11742384.html

python安装matplotlib:python -m pip install matplotlib报错

matplotlib是python中强大的画图模块. 首先确保已经安装python,然后用pip来安装matplotlib模块. 进入到cmd窗口下,建议执行python -m pip install -U pip setuptools进行升级. 接着键入python -m pip install matplotlib进行自动的安装,系统会自动下载安装包. 安装完成后,可以用python -m pip list查看本机的安装的所有模块,确保matplotlib已经安装成功. 如果你能看的上面的m

mac下pip install lxml报错

解决方法: brew install libxml2 xcode-select --install sudo pip install lxml -i http://pypi.v2ex.com/simple

pip install scrapy报错:error: Unable to find vcvarsall.bat解决方法

今天在使用pip install scrapy 命令安装Scrapy爬虫框架时,出现了很让人头疼的错误,错误截图如下: 在网上查找解决方法时,大致知道了问题的原因.是因为缺少C语言的编译环境,其中一种解决方法就是安装相对应版本的Visual Studio,但是安装VS本身就极其麻烦,所以这种方法是不推荐的.第二种方法就是下载已经编译好的安装包. 1. 下载.whl安装包 可以到下面这个网址中下载与python版本以及系统(32位或64位)相匹配的Twisted版本,比如我下载的就是Twisted

ubuntu16.04 pip install scrapy 报错处理

Failed building wheel for Twisted inculde/site/python3.5/Twisted failed with error code 1 in tmp/pip-install-y4-0q..... sudo apt-get install build-essential libssl-dev libffi-dev python3.5-dev# 或者 sudo aptitude install python3.5-dev pip install scrap

python pip install mysql-python报错

报错: 下载地址: https://www.lfd.uci.edu/~gohlke/pythonlibs/#mysql-python 原文地址:https://www.cnblogs.com/sunliyuan/p/10322535.html

pip install mysql_python报错解决办法

首先请注意,mysql_python只支持Python2,所以假如你是python3,就直接用python-connector去吧.下面这一条命令就可以了 pip install mysql-connector 如果不是python3,参考这个网址: https://blog.csdn.net/liujingjie2010/article/details/83541551 另附一些好用的关于python软件的安装地址: https://www.lfd.uci.edu/~gohlke/python