Nazca module is not recognized

edited June 1 in Python scripting

Hello,
I tried to use Python module Nazca through Klayout; but I have a hard to make KL recognize the module. I get "Class moduleNotFoundError".
In my Pc Python, Anaconda, and Nazca are already installed; and can run Nazca from Jupyter.
As you may see, I can present the module from cmd window.
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
(base) C:>python
Python 3.8.8 (default, Apr 13 2021, 15:08:03) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
import nazca
INFO: index.py: Index models version: 0.5.13
nazca
module 'nazca' from 'C:\Users\osaydin\Anaconda3\lib\site-packages\nazca\__init__.py'
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
How can I make KL see the module?

Best regards,
Osman

Comments

  • Hi, Osman!

    KLayout uses built-in Python interpreter. See documentation to learn how to specify additional paths or where to install packages.

  • Bad luck ... that's Windows again.

    There is no package manager on Windows. Hence there is no way, KLayout can reliably link against some "system installation" of Python. KLayout uses the build chain from MSYS2, hence you can make Python modules visible, but the application will crash if they are build with anything else then MinGW gcc.

    And yes I know there is vcpkg for example (https://github.com/microsoft/vcpkg), but they have chosen to use cmake and there is no Ruby there, so that's no way to go.

    I have also tried to build against Anaconda, so at least there could be some coexistence, but I'm not really into debugging ABI incompatibilites, MSVC bugs and all that fancy DevOps stuff. If someone volunteers to maintain this deployment branch, you're welcome.

    Matthias

  • Aha! Now I understand why they use it only on Spyder or Jupyter :smile:
    Thanks anyway,
    Osman

Sign In or Register to comment.