Kipart install questions

OS: MacOS Sierra 10.12.1, SW: Python 2.7.10
I am trying to install Kipart for creating libraries for Xilinx 7z series devices and had some basic questions

  1. Should I be installing Kipart in the Applications/Python directory?
  2. Should I save the file kipart.py in the /Applications/Python directory?
  3. When I try to install the kipart using the command line: $ pip install kipart I get the following message:
    bash: pip: command not found

What may I be doing wrong?

$ easy_install kipart command results in an error where it is asking me to log in as an admin.

That is a path I am trying to go down as well.

-GigaVolt.

I would recommend looking at anaconda / conda if you want to use python scripting on th Mac. You will avoid quite a lot of issues is you use this to run virtual environments. Anaconda allows you to choose which python to run easily and avoid trying to remember what version runs what programme. You can also easily add things like wxpython without breaking other programs.
The Mac standard installation is odd and I am not sure it actually has pip installed so you might have to install that first and you will need an admin pwm for that. Just checking - you are not typing the $ are you?

As for where to put these python programs - it’s up to you. I have a selection of them in a kicad scripting folder but it doesn’t matter…

2 Likes

Thanks John,

Am trying to login as admin and see if that does the trick!!!

I am not typing in $. I was using it to only communicate that I am using a unix prompt.

-GigaVolt.

To get pip in the Apple version of Python you can sudo easy_install pip and then pip shouldn’t need to be run as root. But I would still recommend Anaconda.

I would also install the xcode command line tools by xcode-select --install and Homebrew. That will help in the long run.

1 Like

Instead of Anaconda would Aptana studio work?

I have no experience of Aptana - it looks like it is a complete IDE (cf. Code blocks / Eclipse / Xcode). Probably very good but overkill and not necessary for running KiPart. I only suggested Xcode command line utilities as it also installs a useful bundle of tools that you might find helpful later on. You don’t need the whole of Xcode if you just install the command line utilities using xcode-select --install.

There are two main branches of Python - 2 & 3 and you will find that they are not interoperable. The stock Python in Sierra is 2.7 I think - but some stuff won’t run on anything less than 3.4 and some stuff won’t run on anything more than 2.7… I usually struggle to remember this is which and find that Conda is a lifesaver - you can simply make a ‘Virtual python environment’ with whatever extra modules you need. It won’t interfere with the OS installed Python version and you can have as many virtual environments as you want - one for each Python app that you want to run if you like. You can do all of this with ‘virtenvs’ from the command line but I guess as an OS X user, you might be more comfortable with a GUI - hence the Anaconda recommendation (https://docs.continuum.io/anaconda/#navigator-or-conda) . You can just use conda on the command line or Anaconda Navigator as an GUI. Anaconda will also manage any other packages for you too. For instance, you might need wxpython - installing this in your main python path might cause problems with Kicad as I believe it uses a patched version.

I have a ‘kipart’ virtual environment - I just type source activate kipart and then python kipart.py when in the right directory.

I would also have a look at Homebrew - you can easily install other unix applications using this and it plays nicely with stock OS applications (Or alternatively MacPorts / Fink). It is a bit like apt-get for OS X.

1 Like

sudo easy_install pip worked and pip has been installed. However when I went on to try and install kipart using the following command: pip install kipart, the system automatically downloaded the kipart-0.1.24.zip file as well as future-0.16.0.tar.gz file, I got host of errors Red colored Exceptions and finally an OSError: [Errno 13] Permission Denied: "/Library/Python/2.7/site-packages/affine’

However what worked for me was the following command: sudo easy_install kipart

Now onto actual work…

Thank you very much John. I think if there is a FAQ for installing kipart on the MacOS, we should add this bit of information!

sudo easy_install pip
sudo easy_install kipart