-
Notifications
You must be signed in to change notification settings - Fork 243
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
installation on Python in KLayout #2902
Comments
I've never tried installing it in the macro development from klayout, we usually recommend using klayout as a viewer and installing gdsfactory on a separate python |
Here is a second attempt that works:
And it ran successfully. I was able to get the a layout example to run and save a layout. Now, on to trying to display that layout directly, without saving and loading. Any ideas how @joamatab ? @mustafacc could you please check if this works on Linux? @seanlam97 could you please check if this works on Windows? thank you |
on ubuntu 22.04 it's failing
It seems the issue is with installing the package |
Could you try installing with the "--no-dependencies" option added?
Maybe this can skip the installation of rectpack, and we can see if it is necessary. |
I would highly suggest to move away from installing directly in klayout. It can completely brick systems if used carelessly on linux, on MacOS it can brick your (ana)conda env (since it most likely uses the default brew env). Debian (and most likely other linux distros) is moving towards disallowing people to just install system wide (or even user space) packages with no venv. Therefore, you'd need to at least set This is to safeguard users from accidentially bricking vital system packages like this https://forums.linuxmint.com/viewtopic.php?t=381919 Sure, there are ways to re-enable the old behavior, but that would feel like teaching kids to play on the train tracks in front of the house because it's easily viewable from the balcony. |
@lukasc-ubc It installs okay without dependencies, however, import fails when attempting to load kfactory (another package thats failing to install). @sebastian-goeldi Agreed. I ran this on a VM to not cause any issues with the system's python. I was investigating https://github.com/flaport/condalayout to potentially mitigate this issue on linux but I ran into other issues. |
Btw it works (on linux, but macos should be the same, just different python) with the following which will not abuse/pollute the system/user env (this is debian so maybe cd ~
mkdir kfactory_klayout && cd kfactory_klayout
python3 -m venv .env
source .env/bin/activate
python -m pip install kfactory
KLAYOUT_PYTHONPATH=~/kfactory_klayout/.env/lib/python3.11/site-packages/ klayout with this I was able to successfully import and after a quick test use kfactory. But be advised, at least with the debug console open, it takes a good 10 seconds to import kfactory (not even talking about gdsfactory here). For windows I don't really know, nor do I really have it lying around. My best bet would be WSL2 Also this installation path is a bit asinine as it's installing the pure python klayout within klayout (but this could be mitigated with a different package) |
I tried it but I seem to be running into an issue importing encodings module, even though it can be imported within that env.
echo $KLAYOUT_PYTHONPATH: |
You need to use system python on linux. Or to be more accurate, the python klayout was compiled against. And that, unless you compiled it yourself is probably not 3.12. |
Describe the bug
I am trying to install gdsfactory in KLayout, and I get error below. This is on KLayout HW-klayout-0.29.1-macOS-Monterey-1-qt5MP-RsysPhb311. Perhaps one of the gdsfactory dependancies does not want to install. There are many successful dependancy installations.
Is it possible to have an installation config option that skips some of the dependancies that fail?
Any idea how to fix it?
thank you
To Reproduce
See above.
Expected behavior
that it installs and imports correctly
Suggested fix
Making the import work.
The text was updated successfully, but these errors were encountered: