0

I'm trying to test my installation for Pickit 2 on my Mac for the first time and when I put in: pk2cmd -?v I get:

-bash: /usr/local/bin/pk2cmd: cannot execute binary file

How do I resolve this problem?

Hennes
  • 64,768
  • 7
  • 111
  • 168
Prince Abalogu
  • 101
  • 1
  • 1
  • 1
  • Please, try to see if this link is helpfull: http://curuxa.org/en/Pk2cmd_manual_installation or this: http://www.waveguide.se/?article=programming-pics-using-the-pickit2-and-pk2cmd – Vetras Nov 06 '14 at 17:29

1 Answers1

0

You have a binary executable file pk2cmd for a different architecture than Mac OS X. This system uses executables in the format Mach-O.

You can check the format of your executable using this command:

file /usr/local/bin/pk2cmd

See also this question: How to solve: -bash: : cannot execute binary file.

  • The software was released both for Linux and Mac OS X. See [New PICkit 2 PK2CMD v1.20 for Linux & Mac OS X Released](http://www.microchip.com/forums/m396218.aspx). You probably downloaded the binaries for Linux instead of Mac OS X. – pabouk - Ukraine stay strong Nov 06 '14 at 18:04
  • This is what i get after I put in "file /usr/local/bin/pk2cmd" = \/usr/local/bin/pk2cmd: data – Prince Abalogu Nov 07 '14 at 10:36
  • the link youve sent me leads me to the pickit2 product which I already have and runs perfectly in my uni computers(Microsoft). you saying that I have to buy a completely different Pickit to run on my MAC? – Prince Abalogu Nov 07 '14 at 10:44
  • @ChineduLloydAbalogu, there is also a different possibility - that the binary executable file content is corrupted. For example on [nmap executable binary](http://nmap.org/download.html#macosx) (extracted from the downloaded `nmap-6.47.dmg`) I get: `file -k nmap` `nmap: Mach-O i386 executable`. How did you install the package? Was not the file `.dmg` originally. Did not you just rename it? ------ To your second comment: I have no slightest idea how is Pickit 2 being sold and distributed. :) – pabouk - Ukraine stay strong Nov 07 '14 at 11:04