Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Install issue related to Apple silicon

未关闭
#96 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
macos, python
领域
tooling

调研方向

首先在搭载 Apple silicon 且使用 Python 3.9 的环境中,复现报告的 pip install woocommercefrom woocommerce import API 失败。检查该软件包如何声明其依赖项,并验证在干净安装后无需手动安装 chardet 即可成功导入。

由索引模型根据 Issue 内容生成。

描述

Did a basic install of the library:

pip install woocommerce

Tried to follow example:

from woocommerce import API
Python 3.9.5 (default, May  4 2021, 03:36:27) 
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from woocommerce import API
Traceback (most recent call last):
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/requests/compat.py", line 11, in <module>
    import chardet
ModuleNotFoundError: No module named 'chardet'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/woocommerce/__init__.py", line 17, in <module>
    from woocommerce.api import API
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/woocommerce/api.py", line 12, in <module>
    from requests import request
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/requests/__init__.py", line 45, in <module>
    from .exceptions import RequestsDependencyWarning
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/requests/exceptions.py", line 9, in <module>
    from .compat import JSONDecodeError as CompatJSONDecodeError
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/requests/compat.py", line 13, in <module>
    import charset_normalizer as chardet
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/__init__.py", line 24, in <module>
    from .api import from_bytes, from_fp, from_path, is_binary
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/api.py", line 5, in <module>
    from .cd import (
  File "/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/cd.py", line 14, in <module>
    from .md import is_suspiciously_successive_range
ImportError: dlopen(/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/md.cpython-39-darwin.so, 0x0002): tried: '/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/md.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/md.cpython-39-darwin.so' (no such file), '/Users/user/Library/Python/3.9/lib/python/site-packages/charset_normalizer/md.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

The issue seems to be with chardet, but the secondary issue was related to architecture: (have 'arm64', need 'x86_64').

Solution

pip install chardet

Manually installing chardet fixed the issue.

主要语言
Python
星标
216
派生
108
平均合并
6 小时 34 分钟
30 天内合并 PR
1

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

woocommerce/wc-api-python 的其他 Issue

查看 woocommerce/wc-api-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。