Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PYPI上安装的 wechatpy 缺少 wechatpy.work 模块 #596

Closed
zzbslayer opened this issue Aug 6, 2020 · 2 comments
Closed

PYPI上安装的 wechatpy 缺少 wechatpy.work 模块 #596

zzbslayer opened this issue Aug 6, 2020 · 2 comments
Labels

Comments

@zzbslayer
Copy link

问题描述 (Description)

pip install wechatpy

通过 pip 安装的 wechatpy 缺少 wechatpy.work 模块,无法进行企业微信api的开发。

pip install https://github.com/wechatpy/wechatpy/archive/master.zip

直接安装 github master 版本是没有问题的。

配置信息 (Environment/Version)

  • OS
    Windows10 & CentOS 7

  • Python
    3.7 & 3.8

  • wechatpy
    1.8.13 not works
    github master works

重现步骤 (Reproducing)

pip install wechatpy
python
>>> import wechatpy # This works
>>> from wechatpy.work.crypto import WeChatCrypto # raise error
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'wechatpy.work'
@zzbslayer zzbslayer added the bug label Aug 6, 2020
@huimingz
Copy link
Contributor

huimingz commented Aug 6, 2020

master做了重命名修改#538,目前发布的没有,所以通过pip安装的应该通过from wechatpy. enterprise import xxx进行调用。考虑到之后的兼容问题,建议可以用下面的方式

try:
    from wechatpy.enterprise import xxx
except ImportError:
    from wechatpy.work import xxx

@messense messense mentioned this issue Aug 21, 2020
@messense messense pinned this issue Nov 22, 2020
@messense
Copy link
Member

issue 关闭,先置顶提高可见性。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants