Replies: 7 comments 2 replies
-
Are you running the example within KLayout Application? If so, please try this: Open the Macro Editor (F5). In the Console, choose Python, and type in:
|
Beta Was this translation helpful? Give feedback.
-
I found the issue was with pip being called from siepic_ebeam_pdk 0.4.27 - SiEPIC EBeam PDK
The error box returned that 'pip' was missing, and that despite declaring a pyenv version 3.10 I was still using the system python 3.12.3 such that pip was not supported. I couldn't figure out how to make klayout recognize pyenv python for the tool packages. The fix for me was instead to enable pip and then install the dependent libraries using the following commands:
which I found instructions for at this website: https://codedamn.com/news/python/how-to-fix-no-module-named-pip When pip was enabled, consecutive libraries 'numpy', 'scipy' were then indicated as also not being installed returning
I installed these packages with
In this process, I received the following message:
Therefore, it seems that the pip command is out-dated, which is why the package manager cannot work with newer versions of python. It may be that pip won't be available in the future, or a slightly different command will be required. |
Beta Was this translation helpful? Give feedback.
-
Can you please clarify: are you running KLayout as a GUI Application? Or are you running it in Python (VSCode, etc), and using “import klayout, siepic_ebeam_pdk …”?
From what you write below, it looks like it is within the GUI, but with an external Python environment. In this case, you should be able to install the packages externally, as long as KLayout is built to the corresponding python installation.
I am more familiar with the Mac installation, which comes in “heavyweight” and “lightweight”. The hw version includes a full python environment, and the only way to install packages is using the deprecated pip function. For the lw version, it is similar to the Linux one, where you can install packages externally as you are doing.
So you have numpy working now?
|
Beta Was this translation helpful? Give feedback.
-
I am running KLayout as a GUI application, but on Ubuntu 24.04. On this Linux OS, KLayout calls the system python version which is Python 3.12.3. However, Python 3.12.3 does not have pip but pip3 by default, and installing earlier Python version affects the Linux OS package manager if not installed and used separately. Instead, I brought back pip, then numpy and scipy with Python 3.12.3 so I can successfully use the SiEPIC packages in KLayout with Python 3.12.3 with no errors. Python 3.12.3 can use the deprecated pip, but future Python versions may not. I have pip working now so the SiEPIC packages can import updated pip, scipy, and numpy to KLayout. |
Beta Was this translation helpful? Give feedback.
-
Could you not install numpy using pip3? Numpy is such a standard package that all Python installations should easily have it.
|
Beta Was this translation helpful? Give feedback.
-
I was having the same issues after updating to KLayout version 0.28.17. The problem stemmed from (a) the pip command used by SiEPIC.install to install the correct Python dependencies was not working, and (b) the "heavyweight" (HW) version of KLayout I had installed will create its own Python environment with a specific version of Python (3.11.7 in my case) which is not directly in my python environment path, so typing "pip3 install numpy" in my terminal is no help. The fix I found was as follows:
After this I had no issues running any SiEPIC PCells or SiEPIC tools functionality. My KLayout also stopped prompting me every time I opened it to install those packages... which makes sense. Hope this helps someone! |
Beta Was this translation helpful? Give feedback.
-
Is there a reason you are using an old version (0.28) of KLayout, rather than the latest 0.29?
|
Beta Was this translation helpful? Give feedback.
-
On Ubuntu 24.04, I installed this package in to KLayout 0.29.8 using Python_packages_for_KLayout 1.2, siepic_tools 0.5.14 and siepic_ebeam_pdk 0.4.27. Attempting to open the MZI example layout returns the following error:
ModuleNotFoundError: No module named 'numpy'
I tried:
Beta Was this translation helpful? Give feedback.
All reactions