llvm / llvm/circt

[PyCDE] No module named "numpy"/"jinja2" during compilation

Open
#5,014 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
2.2k
Forks
524
Avg merge
3d 2h
Merged PRs (30d)
46

Description

When I try to compile PyCDE (cannot install cause using Apple M1), I have the following error (in many places):

```
Traceback (most recent call last):
File "/Users/vmois/Projects/circt/frontends/PyCDE/test/test_xrt.py", line 20, in
import pycde
File "/Users/vmois/Projects/circt/frontends/PyCDE/build/cmake_build/tools/circt/python_packages/pycde/pycde/__init__.py", line 22, in
from .module import (generator, modparams, Module)
File "/Users/vmois/Projects/circt/frontends/PyCDE/build/cmake_build/tools/circt/python_packages/pycde/pycde/module.py", line 11, in
from .signals import ClockSignal, Signal, _FromCirctValue
File "/Users/vmois/Projects/circt/frontends/PyCDE/build/cmake_build/tools/circt/python_packages/pycde/pycde/signals.py", line 18, in
import numpy as np
ModuleNotFoundError: No module named 'numpy'
```
After checking required packages, I can see that numpy is present:

https://github.com/llvm/circt/blob/c9c359159ad977892e13865e83c8cd0951b21e74/frontends/PyCDE/pyproject.toml#L2-L17

I have installed numpy manually (`pip install numpy`), but now a different package is missing - `jinja2`. After manually installing `jinja2`, I managed to build pycde and it works! But, strangely, packages are not found while specified in `required`. Any ideas why it can be?

I am using conda env and Python 3.8.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with frontends/PyCDE/pyproject.toml and the import path shown in the traceback, then reproduce test/test_xrt.py in a conda environment using Python 3.8. Check why the declared numpy and jinja2 dependencies are unavailable during the PyCDE build; done means a supported build environment resolves them without manual installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.