Closed flaviut closed 1 year ago
Hi @flaviut !
WARNING:(W010) Unable to find KiCad libraries (kibot - config.py:403)
Where are your libs installed? Aren't they at /usr/share/kicad/symbols/
?
They are!
$ ls /usr/share/kicad/symbols/
4xxx_IEEE.kicad_sym MCU_Microchip_SAMV.kicad_sym
4xxx.kicad_sym MCU_Module.kicad_sym
74xGxx.kicad_sym MCU_Nordic.kicad_sym
74xx_IEEE.kicad_sym MCU_NXP_ColdFire.kicad_sym
74xx.kicad_sym MCU_NXP_HC11.kicad_sym
Amplifier_Audio.kicad_sym MCU_NXP_HC12.kicad_sym
Looking at https://github.com/INTI-CMNB/KiBot/blob/1248e92b9556cbcaf82c3a36577bc98b0c9dc61f/kibot/kicad/config.py#L180, it seems like the autodetection only works for KICAD_SYMBOL_DIR
rather than the KICAD6_SYMBOL_DIR
involved here?
Hi @flaviut ! Which version are you running? Try upgrading to 1.4.0
ah, I see. dev is actually the main branch here, not master. If you'd like, you can adjust things on github so that dev is shown by default, and so that the github code search uses dev:
But I am on 1.4.0, freshly installed from pip about a week ago:
$ kibot -V
KiBot 1.4.0 - Copyright 2018-2022, Salvador E. Tropea/INTI/John Beard - License: GPL v3+
Hi @flaviut !
The master
is currently the last release, and dev
is the WIP code.
The current code doesn't use the line you mention.
Can you try running the following Python script?
import os
import platform
import sysconfig
system = platform.system()
share = os.path.join('share', 'kicad', 'symbols')
if system == 'Linux':
scheme_names = sysconfig.get_scheme_names()
# Try in local dir
if 'posix_user' in scheme_names:
dir = os.path.join(sysconfig.get_path('data', 'posix_user'), share)
print('Try '+dir)
if os.path.isdir(dir):
print(dir+' Ok')
exit(0)
# Try at system level
if 'posix_prefix' in scheme_names:
dir = os.path.join(sysconfig.get_path('data', 'posix_prefix'), share)
print('Try '+dir)
if os.path.isdir(dir):
print(dir+' Ok')
exit(0)
else:
print("Not Linux")
The master is currently the last release, and dev is the WIP code.
ok, I understand now.
Can you try running the following Python script?
Try /home/user/etc/.local/share/kicad/symbols
Try /home/user/tmp/AWG/venv/share/kicad/symbols
looks like it's trying to look for symbols in my virtualenv. doesn't seem like sysconfig works very well in this situation:
>>> sysconfig.get_paths()
{'stdlib': '/usr/lib/python3.10', 'platstdlib': '/home/user/tmp/AWG/venv/lib/python3.10', 'purelib': '/home/user/tmp/AWG/venv/lib/python3.10/site-packages', 'platlib': '/home/user/tmp/AWG/venv/lib/python3.10/site-packages', 'include': '/usr/include/python3.10', 'platinclude': '/usr/include/python3.10', 'scripts': '/home/user/tmp/AWG/venv/bin', 'data': '/home/user/tmp/AWG/venv'}
Hi @flaviut !
Why do you need a virtualenv? I never use it.
It looks like the virtualenv is preventing KiBot from finding vital information about your system.
You could symlink the KiCad resources dir in your virtualenv (ln -s /usr/share/kicad /home/user/tmp/AWG/venv/share/kicad
)
Or you can just define the variables in your environment using export
. You can use your ~/.bashrc
file to make it persistent.
Why do you need a virtualenv? I never use it.
It's good to have the correct version of kibot for each project. But now that you mention it, it doesn't make much sense since kicad is still from the system's packages.
Or you can just define the variables in your environment using export. You can use your ~/.bashrc file to make it persistent.
Thank you for the really good advice--these are great workarounds.
Hi @flaviut ! Note that we currently have some docker images with specific versions of KiBot and KiCad. Currently GitHub is giving us enough space to host them, not sure how much images we will be able to keep. But if you really needed reproducibility you can use these images.
Describe the bug
When I run KiBot with my Kicad 6.0.9 installation, it has trouble finding the various system libraries. This is because the environment variables like
KICAD6_SYMBOL_DIR
are not included in the.config/kicad/6.0/kicad_common.json
file for some reason. Manually adding them in works, but then Kicad removes them again when the settings are saved.Not sure how this can be fixed--KiCad uses a compile-time configured path for symbol libraries: 1, 2.
Log output:
.config/kicad/6.0/kicad_common.json
:Environment (please complete the following information): Where are you running KiBot: