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

xilinx: ModuleNotFoundError: No module named 'distutils.spawn' #407

Closed
xobs opened this issue Mar 3, 2020 · 3 comments
Closed

xilinx: ModuleNotFoundError: No module named 'distutils.spawn' #407

xobs opened this issue Mar 3, 2020 · 3 comments

Comments

@xobs
Copy link
Collaborator

xobs commented Mar 3, 2020

When building on a stock Ubuntu 18.04 Python distribution, litex produces the following error:

Traceback (most recent call last):
  File "./betrusted-sim.py", line 18, in <module>
    from litex.build.xilinx import XilinxPlatform
  File "/mnt/c/Users/smcro/Code/Betrusted/sim/deps/litex/litex/build/xilinx/__init__.py", line 2, in <module>
    from litex.build.xilinx.programmer import UrJTAG, XC3SProg, FpgaProg, VivadoProgrammer, iMPACT, Adept
  File "/mnt/c/Users/smcro/Code/Betrusted/sim/deps/litex/litex/build/xilinx/programmer.py", line 10, in <module>           from distutils.spawn import find_executable
ModuleNotFoundError: No module named 'distutils.spawn'

I have set compile_gateware=False as I'm just trying to generate Verilog code. Commenting out from distutils.spawn import find_executable in both vivado.py and programmer.py gets it working again.

@enjoy-digital
Copy link
Owner

This seems similar to pypa/pipenv#2922, can you try installing python3-distutils with: sudo apt-get install python3-distutils ?

@xobs
Copy link
Collaborator Author

xobs commented Mar 4, 2020

That does seem to solve the issue.

It looks like that module isn't included by default on Ubuntu, nor is it included in the official Windows Embedded distribution. Should this module be used here, given that it's not universally installed, and it doesn't appear to be designed for this usecase, given it's not being used to install additional Python modules:

The distutils package provides support for building and installing additional modules into a Python installation. The new modules may be either 100%-pure Python, or may be extension modules written in C, or may be collections of Python packages which include modules coded in both Python and C.

Most Python users will not want to use this module directly, but instead use the cross-version tools maintained by the Python Packaging Authority. 

@enjoy-digital
Copy link
Owner

Thanks for the feedback. find_executable from distutils.spawn has been used as part of fda18fd since distutils was already used for auto-sourcing ISE/Vivado. With 0b923aa, auto-sourcing is removed (since not consistent for all build backends, difficult to do correctly without real additional value and since it's in fact probably better to let the user install and choose the toolchain that will be used) and this also removes distutils dependency.

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

No branches or pull requests

2 participants