添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
安静的松树  ·  ImportError: DLL load ...·  昨天    · 
魁梧的排球  ·  Issue ...·  昨天    · 
机灵的手电筒  ·  Re:openvino.runtime - ...·  昨天    · 
粗眉毛的青蛙  ·  spark ...·  20 小时前    · 
健壮的烤地瓜  ·  pip install -r ...·  3 小时前    · 
精明的饺子  ·  Announcements, Data & ...·  4 天前    · 
聪明伶俐的馒头  ·  Nat. Mach. Intell. | ...·  1 月前    · 
烦恼的水桶  ·  Data, ...·  2 月前    · 

ModuleNotFoundError: No module named <’_bz2’, ‘_sqlite3’> #

Users may experience a ModuleNotFoundError for some Python provided packages on their local machine.

Observed Error #

This line of code

import bz2

gives error:

Traceback (most recent call last):
import bz2
File "/usr/local/lib/python3.8/bz2.py", line 19, in <module>
    from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'

Explanation#

Python installation was built from source but didn’t have all necessary system packages installed for full Python build.

Work around#

Install bzip2-devel and sqlite-devel and rebuild Python, or download a pre-built Python binary.

ModuleNotFoundError: No module named <…>#

Users may experience a ModuleNotFoundError for some Python packages that are available on their local machine.

Explanation#

The Custom Worker Container Workflow provides seamless support for importing user-specific dependency packages in the Python environments into the Cerebras appliances. In case of failure, a fallback policy has also been enabled to mount the site packages from the user node Python virtual environment to the worker environment via a predefined NFS-based cluster volume.

Work around#

If you observe a ModuleNotFoundError, you can disable the Custom Worker Container Workflow by following the instructions here, and follow the R1.8 approach:

  • pip install the packages in virtual environment

  • Copy the custom package directory from venv/lib/python3.8/site-packages/<package_name> to a NFS-mountable location for the Cerebras cluster. Only copy the custom packages, not the entire virtual environment.

  • Make sure to add this location to the --mount_dirs command line argument and the corresponding parent location to the --python_paths command line argument when calling run.py.

  •