kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #22480
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
-
To:
kicad-developers@xxxxxxxxxxxxxxxxxxx
-
From:
Clemens Koller <cko@xxxxxxxxx>
-
Date:
Mon, 11 Jan 2016 00:31:27 +0100
-
In-reply-to:
<CAOuK9LgbaXebw8e5rim=C-PEv6-dLOy5KE5pWcMkTQCA_-Ciyw@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
Hi!
>>> It gets more interesting when I add the path to pcbnew.py:
>>>
>>> $ PYTHONPATH=~/SW/lib/python2.7/site-packages ./pcbnew
>>
>> I believe you wanted to do:
>>
>> $ export PYTHONPATH=~/SW/lib/python2.7/site-packages ./pcbnew
>
> You don't need the export when you write the variable before the
> command like this. But I am unsure if the tilde behaves as you expect
> here. One could try to use ${HOME} or actually write /home/username
> instead of the tilde.
Python internally resolves the ~/... properly to /home/<username>/...
and puts it in the front of the search path:
$ PYTHONPATH=~/SW/lib/python2.7/site-packages python
Python 3.5.1 (default, Dec 7 2015, 12:58:09)
[GCC 5.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.path)
['', '/home/admin/SW/lib/python2.7/site-packages', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-linux', '/usr/lib/python3.5/lib-dynload', '/usr/lib/python3.5/site-packages']
>>> Traceback (most recent call last):
>>> File "<string>", line 3, in <module>
>>> File "/home/admin/SW/lib/python2.7/site-packages/pcbnew.py", line 5055, in <module>
>>> class BOARD(BOARD_ITEM):
>>> File "/home/admin/SW/lib/python2.7/site-packages/pcbnew.py", line 5710, in BOARD
>>> def GetViaByPosition(self, aPosition, aLayer=UNDEFINED_LAYER):
>>> NameError: name 'UNDEFINED_LAYER' is not defined
>>>
>>> I am not into the python internals, but it seems something smells down that road.
>>> We can just declare installing kicad with python support as non-root currently
>>> as "unsupported". I am fine with that for now.
>>
>> At least you resolved you module load issue so that's a step in the
>> right direction. I don't know how thoroughly the Python module code has
>> been tested so you may find some issues here and there.
If somebody wants me to debug something in this area, let me know.
Otherwise, I'll stop digging at this place and call it a day.
Regards,
Clemens
Follow ups
References
-
Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Jon Neal, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Nick Østergaard, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Wayne Stambaugh, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Wayne Stambaugh, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: jp charras, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Wayne Stambaugh, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Nick Østergaard, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-08
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Strontium, 2016-01-09
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Clemens Koller, 2016-01-10
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Wayne Stambaugh, 2016-01-10
-
Re: Opening pcbnew from kicad: ImportError: No module named pcbnew
From: Nick Østergaard, 2016-01-10