Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

AttributeError: module 'pkg_resources' has no attribute 'declare_namespace'

Open Beginner friendly
#115 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
python
Domain
api

Research direction

Start with ws/pb/google/init.py and reproduce the import failure using setuptools 81.0.0 or newer with Python 3.12. Check the package’s namespace initialization there and verify that installing version 1.5.3 no longer raises AttributeError without requiring a setuptools pin.

Written by the indexing model from the issue text.

Description

版本: 1.5.3

报错日志:
lib/python3.12/site-packages/lark_oapi/ws/pb/google/init.py", line 2, in
import('pkg_resources').declare_namespace(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkg_resources' has no attribute 'declare_namespace'

2026年开始Setuptools 81.0.0+ 删除了 pkg_resources.declare_namespace

临时解决方案:
pin setuptools版本:

setuptools<81

或者手工改下代码ws/pb/google/init.py

Dominant language
Python
Stars
559
Forks
102
PR merge metrics
No merged PRs in 30d

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from larksuite/oapi-sdk-python

All issues in larksuite/oapi-sdk-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.