最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[记录]安装Python微信SDK包:wechat-sdk

Python crifan 3941浏览 0评论

折腾:

[已解决]尝试把Python版微信SDK wechat-python-sdk集成到Flask中

期间,去安装wechat-sdk

(SIPEvents)  SIPEvents pip install wechat-sdk
Collecting wechat-sdk
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc8b59d7650>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc8b59d77d0>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc8b59d7950>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc8b59d7ad0>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by ‘NewConnectionError(‘<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7fc8b59d7c50>: Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/
  Could not find a version that satisfies the requirement wechat-sdk (from versions: )
No matching distribution found for wechat-sdk
(SIPEvents)  SIPEvents easy_install install wechat-sdk
Searching for install
Reading https://pypi.python.org/simple/install/
Download error on https://pypi.python.org/simple/install/: [Errno -2] Name or service not known — Some packages may not be found!
Couldn’t find index page for ‘install’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known — Some packages may not be found!
No local packages or working download links found for install
error: Could not find suitable distribution for Requirement.parse(‘install’)
(SIPEvents)  SIPEvents

去通过源码安装:

wget https://github.com/wechat-python-sdk/wechat-python-sdk/archive/master.tar.gz
tar zvxf master.tar.gz
cd wechat-python-sdk-master
python setup.py build
python setup.py install

最后还是出错:

(SIPEvents)  SIPEvents wget https://github.com/wechat-python-sdk/wechat-python-sdk/archive/master.tar.gz

<div–<2016-08-17 15:35:43–  https://github.com/wechat-python-sdk/wechat-python-sdk/archive/master.tar.gz

Resolving github.com… 192.30.253.112
Connecting to github.com|192.30.253.112|:443… connected.
HTTP request sent, awaiting response… 301 Moved Permanently
Location: https://github.com/doraemonext/wechat-python-sdk/archive/master.tar.gz [following]

<div–<2016-08-17 15:35:44–  https://github.com/doraemonext/wechat-python-sdk/archive/master.tar.gz

Connecting to github.com|192.30.253.112|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://codeload.github.com/doraemonext/wechat-python-sdk/tar.gz/master [following]

<div–<2016-08-17 15:35:47–  https://codeload.github.com/doraemonext/wechat-python-sdk/tar.gz/master

Resolving codeload.github.com… 192.30.253.121
Connecting to codeload.github.com|192.30.253.121|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/x-gzip]
Saving to: aster.tar.gz
    [      <=>                                                                                      ] 200,457      116K/s   in 1.7s    
2016-08-17 15:35:51 (116 KB/s) – aster.tar.gzsaved [200457]
(SIPEvents)  SIPEvents ll
total 220K
-rw-r–r– 1 root root  735 Aug 17 14:39 flash.py
-rw-r–r– 1 root root 1.1K Aug 17 14:39 flash.pyc
-rw-r–r– 1 root root  707 Aug 16 15:23 hello.py
-rw-r–r– 1 root root 1.3K Aug 16 15:31 hello.pyc
-rw-r–r– 1 root root 196K Aug 17 15:35 master.tar.gz
drwxr-xr-x 2 root root 4.0K Aug 16 15:01 static
drwxr-xr-x 2 root root 4.0K Aug 17 14:38 templates
(SIPEvents)  SIPEvents tar xvzf master.tar.gz 
wechat-python-sdk-master/
wechat-python-sdk-master/.gitignore
wechat-python-sdk-master/CONTRIBUTORS.txt
wechat-python-sdk-master/LICENSE.txt
wechat-python-sdk-master/MANIFEST.in
wechat-python-sdk-master/README.rst
wechat-python-sdk-master/docs/
wechat-python-sdk-master/docs/.gitignore
wechat-python-sdk-master/docs/docs/
。。。
Download error on https://pypi.python.org/simple/xmltodict/: [Errno -2] Name or service not known — Some packages may not be found!
Couldn’t find index page for ‘xmltodict’ (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known — Some packages may not be found!
No local packages or working download links found for xmltodict==0.9.2
error: Could not find suitable distribution for Requirement.parse(‘xmltodict==0.9.2’)

error: Could not find suitable distribution for Requirement.parse(‘xmltodict==0.9.2’)

error: Could not find suitable distribution for xmltodict

Problems with python easy install – Stack Overflow

Failed to establish a new connection: [Errno -2] Name or service not known’,)’: /simple/wechat-sdk/

Failed to establish a new connection /simple/wechat-sdk

No matching distribution found for wechat-sdk

No matching distribution found for wechat-sdk

Could not find suitable distribution for Requirement.parse

根据之前的:

Download error on https://pypi.python.org/simple/: [Errno -2] Name or service not known — Some packages may not be found!
No local packages or working download links found for xmltodict==0.9.2
error: Could not find suitable distribution for Requirement.parse(‘xmltodict==0.9.2’)

去尝试安装那个所谓的:

xmltodict==0.9.2

搜:

python xmltodict 0.9.2

martinblech/xmltodict: Python module that makes working with XML feel like you are working with JSON

(SIPEvents)  wechat-python-sdk-master pip install xmltodict
Collecting xmltodict
  Downloading xmltodict-0.10.2.tar.gz
Building wheels for collected packages: xmltodict
  Running setup.py bdist_wheel for xmltodict … done
  Stored in directory: /root/.cache/pip/wheels/2a/dc/70/da8958d7089d994c8614bc38210f64855f09615e85707bf615
Successfully built xmltodict
Installing collected packages: xmltodict
Successfully installed xmltodict-0.10.2

再去:

python setup.py build

python setup.py install

(SIPEvents)  wechat-python-sdk-master python setup.py build  
running build
running build_py
running egg_info
writing requirements to wechat_sdk.egg-info/requires.txt
writing wechat_sdk.egg-info/PKG-INFO
writing top-level names to wechat_sdk.egg-info/top_level.txt
writing dependency_links to wechat_sdk.egg-info/dependency_links.txt
reading manifest file ‘wechat_sdk.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
warning: no files found matching ‘docs/*.rst’
warning: no files found matching ‘docs/*.py’
warning: no files found matching ‘docs/Makefile’
writing manifest file ‘wechat_sdk.egg-info/SOURCES.txt’
(SIPEvents)  wechat-python-sdk-master python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to wechat_sdk.egg-info/requires.txt
。。。
no previously-included directories found matching ‘documentation/_build’
zip_safe flag not set; analyzing archive contents…
six: module references __path__
creating /root/Envs/SIPEvents/lib/python2.7/site-packages/six-1.10.0-py2.7.egg
Extracting six-1.10.0-py2.7.egg to /root/Envs/SIPEvents/lib/python2.7/site-packages
Adding six 1.10.0 to easy-install.pth file
Installed /root/Envs/SIPEvents/lib/python2.7/site-packages/six-1.10.0-py2.7.egg
Finished processing dependencies for wechat-sdk==0.6.4

期间,安装了所依赖的库:

xmltodict==0.9.2

pycrypto==2.6.1

requests==2.6.0

six==1.10.0

最终安装了:

wechat-sdk==0.6.4

转载请注明:在路上 » [记录]安装Python微信SDK包:wechat-sdk

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.190 seconds, using 22.25MB memory