Kicad python pip is working?


#1

I noticed that pip is distributed both with stable and dev releases of kicad…
but I tried to use pip to install a python module both in kicad stable and latest dev without succeed…

is pip functionality working for kicad in windows?

thx
Maurice


#2

@nickoe
I was trying to install through pip a library useful for Via Fence stitching
Particularly the module is

pyclipper

(an other option would be to just add pyclipper to win distribution)

thanks for having a look at it

Maurice


#3

Did you check the pip installation itself… I think there was an option to update it?


#4

yes, already tested with

python -m pip install --upgrade pip

still I cannot install pyclipper


#5

hm… and pyclipper can be installed in run-of-the-mill python installations with pip?

PS: I’m sure you already tried that, it’s just me doodeling around on my keyboard before going to bed :wink:

PPS: … while watching an IoT project of mine going bonkerz and not doing what it’s supposed to around this time of the day. Damnit, now I have to lower that 12m aluminium mast tomorrow… sad.
:head_bandage:


#6

no way…
I’m going to try to install pyclipper in my building mingw chain… that could work

EDIT
bingo! that is working! Now I can add python modules to my win kicad installation… very unfriendly that the standard distro cannot use pip directly…
M

EDIT2
also this trick unfortunately is not working for numpy!


Anyone installed NumPy for use with KiCAD's python?
#7

It is supposed to work, but I am not sure if does so or not. From which console do you install it?


#8

I just launch the Command Prompt
and then for example:

cd %programfiles%\Kicad\bin
pip install pyclipper


#9

Do you think it would help if you posted the error messages?


#10

here it is

Microsoft Windows [Version 10.0.14393]
© 2016 Microsoft Corporation. All rights reserved.

C:\Users\userC>cd %programfiles%\Kicad\bin

C:\Program Files\KiCad\bin>pip install pyclipper
Collecting pyclipper
Using cached pyclipper-1.0.6.zip
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_scm_git_archive/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
Download error on https://pypi.python.org/simple/setuptools-scm-git-archive/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
Couldn’t find index page for ‘setuptools_scm_git_archive’ (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
No local packages or working download links found for setuptools_scm_git_archive>=1.0
Distribution mode: Compiling Cython generated .cpp sources.
Traceback (most recent call last):
File “”, line 1, in
File “c:\users\userc\appdata\local\temp\pip-build-rvhaub\pyclipper\setup.py”, line 91, in
cmdclass=cmdclass,
File “C:\Program Files\KiCad\lib\python2.7/distutils/core.py”, line 111, in setup
_setup_distribution = dist = klass(attrs)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 316, in init
self.fetch_build_eggs(attrs[‘setup_requires’])
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 371, in fetch_build_eggs
replace_conflicting=True,
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 1118, in best_match
return self.obtain(req, installer)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 1130, in obtain
return installer(requirement)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 439, in fetch_build_egg
return cmd.easy_install(req)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/command/easy_install.py”, line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse(‘setuptools_scm_git_archive>=1.0’)

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in c:\users\userc\appdata\local\temp\pip-build-rvhaub\pyclipper\

C:\Program Files\KiCad\bin>

but you should be able to replicate it just launching the command I posted


#11

It looks like setuptools_scm_git_archive requires Python 3, although pyclipper claims to work with 2.7.

KiCad is python 2.7. I would raise an issue on pyclipper github, I don’t think it is a KiCad issue.


#12

not really,

I can build and use pyclipper.pyc, as I pointed out before, using my building chain for kicad in python 2.7.11

So this is an issue in kicad pip installation structure


#13

Hmm, yes I think you are right. I tried installing pyclipper into my system python2.7 and it worked fine.

My next hunch is something to do with SSL certificates.


#14

Could you try pip install --cert …\ssl\certs\ca-bundle.crt pyclipper ?


#15

Microsoft Windows [Version 10.0.14393]
© 2016 Microsoft Corporation. All rights reserved.

C:\Users\userC>cd %programfiles%\Kicad\bin

C:\Program Files\KiCad\bin>pip install --cert …\ssl\certs\ca-bundle.crt pyclipper
Collecting pyclipper
Using cached pyclipper-1.0.6.zip
Complete output from command python setup.py egg_info:
Download error on https://pypi.python.org/simple/setuptools_scm_git_archive/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
Download error on https://pypi.python.org/simple/setuptools-scm-git-archive/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
Couldn’t find index page for ‘setuptools_scm_git_archive’ (maybe misspelled?)
Download error on https://pypi.python.org/simple/: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:661) – Some packages may not be found!
No local packages or working download links found for setuptools_scm_git_archive>=1.0
Distribution mode: Compiling Cython generated .cpp sources.
Traceback (most recent call last):
File “”, line 1, in
File “c:\users\userc\appdata\local\temp\pip-build-wj3he3\pyclipper\setup.py”, line 91, in
cmdclass=cmdclass,
File “C:\Program Files\KiCad\lib\python2.7/distutils/core.py”, line 111, in setup
_setup_distribution = dist = klass(attrs)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 316, in init
self.fetch_build_eggs(attrs[‘setup_requires’])
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 371, in fetch_build_eggs
replace_conflicting=True,
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 846, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 1118, in best_match
return self.obtain(req, installer)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/pkg_resources/init.py”, line 1130, in obtain
return installer(requirement)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/dist.py”, line 439, in fetch_build_egg
return cmd.easy_install(req)
File “C:\Program Files\KiCad\lib\python2.7\site-packages/setuptools/command/easy_install.py”, line 659, in easy_install
raise DistutilsError(msg)
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse(‘setuptools_scm_git_archive>=1.0’)

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in c:\users\userc\appdata\local\temp\pip-build-wj3he3\pyclipper\

C:\Program Files\KiCad\bin>


#16

I don’t know how pip works, please let me know if you find a way to fix this.