iqm-finland / KQCircuits

KLayout Python library for integrated quantum circuit design.
GNU General Public License v3.0
128 stars 71 forks source link

Installing missing python packages in windows #24

Closed srjmas closed 1 year ago

srjmas commented 1 year ago

Failed installation of KQC 4.5.0 in Klayout 0.27.2 and 0.26.12 on Windows 10

First a dialog appears:

Install packages? Install missing packages using 'pip': autologging, tqdm, networkx &Yes &No

I click Yes, no visible response Then startup macros are executed with the following errors:

C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\library_helper.py:33: No module named 'autologging' C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\library_helper.py:33 C:/Users/srj/KLayout/salt/KQCircuits/python/scripts/macros/library.lym:20 (class ModuleNotFoundError) C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\klayout_view.py:19: No module named 'autologging' C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\klayout_view.py:19 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\macro_prepare.py:20 C:/Users/srj/KLayout/salt/KQCircuits/python/scripts/macros/startup.lym:19 (class ModuleNotFoundError)

Trying 'pip' in command prompt leads to 'is not recognized'

What can be done?

update: tried to install manually the missing packages pip install tqdm==4.61 --target C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\ pip install autologging==1.3.2 --target C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\ pip install networkx==2.7 --target C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\

now I get a new set of errors C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes\graph.py:11: cannot import name 'cached_property' from 'functools' (C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\functools.py) C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes\graph.py:11 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes__init.py:1 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\init.py:61 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\importlib\init.py:127 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\dependencies.py:49 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\init.py:27 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\library_helper.py:35 C:/Users/srj/KLayout/salt/KQCircuits/python/scripts/macros/library.lym:20 (class ImportError) C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes\graph.py:11: cannot import name 'cached_property' from 'functools' (C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\functools.py) C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes\graph.py:11 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\classes\init.py:1 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\site-packages\networkx\init.py:61 C:\Users\srj\AppData\Roaming\KLayout\lib\python3.7\importlib\init.py:127 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\dependencies.py:49 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\init__.py:27 C:\Users\srj\KLayout\salt\KQCircuits\python\kqcircuits\util\macro_prepare.py:20 C:/Users/srj/KLayout/salt/KQCircuits/python/scripts/macros/startup.lym:19 (class ImportError)

qpavsmi commented 1 year ago

Did you install with a Salt package or by following this guide: https://iqm-finland.github.io/KQCircuits/developer/setup.html ? I'd recommend reinstalling KQC and to try again, unless you have already tried that. I would also recommend using a newer KLayout version, like 0.27.11 (newest version is 0.27.12 but we have recently found some of the KQC features not working for it and are working on fixing those)

srjmas commented 1 year ago

Thank you, it seems to work now!

I think that the Salt package remained alive through several reinstallations, until I started to delete folders manually. But after it was gone (no KQC libraries after fresh KLayout re-install), the developer guide worked just fine with Klayout 0.27.11