2

I would require some guidance in regards to installing a module/package in pycharm (free edition). I have to mention that i have not worked with this IDE yet and wanted to try it out on a little project containing smartcards.

When i try to install "pyscard" i get the error that boils down to

error: command 'swig.exe' failed: No such file or directory

People say just install SWIG, which i guessed already ^^. The issue i have is that i actually have no idea how to... and none of the pages i found has really enlightended me on this issue.

I downloaded the zip "swigwin-3.0.12" but i am at a loss what to do with it now. EDIT: According to the SWIG page this is an already compiled version and i have to somehow make pycharm recognize that the folder it is in contains the swig.exe it requires.

EDIT2: Adding the folder containing the swig.exe to the PATH variable also did not work ... which i thought would be the issue

EDIT3+Answer: Ok the link in the comments from "wp78de" was correct my problem was that pycharm/pc restart were needed for it to catch the added PATH variable to the swig.exe (for pycharm that is)

Any advice is appriciated.

Envoirment:

Windows 8.1 Pro 64-bit

Pycharm 2017.2.4

Python 3.6

Jan Kubik
  • 25
  • 6
  • Possible duplicate of [How to install SWIG?](https://stackoverflow.com/questions/7443112/how-to-install-swig) – wp78de Nov 13 '17 at 00:48
  • yes i have seen that one already but the problem as far as i see it, is that i already get a compiled version of it , ergo i would not need to do that .. either way there is nothing in said folder that would interact with a configure command ... as far as i know i need to add the swig folder to pycharm somehow so it knows it is present ... and i have no clue how to do so – Jan Kubik Nov 13 '17 at 01:24
  • Have you looked at the second answer (with much more up votes than the accepted answer)? Basically, add swig.exe to your `%PATH%`. – wp78de Nov 13 '17 at 01:32
  • yeah actually tried it .. did not work .. yet :/ ill see if i can run it from cmd like that or some stuff :) EDIT: ok CMD finds swig.exe whereever i run it from just pycharm does not want to -.- EDIT2: ok i restarted pycharm and my PC now it works and needs some other stuff but i should be able to handle that ... can you make a real answer so i can mark it as correct ? – Jan Kubik Nov 13 '17 at 01:37

1 Answers1

0

Basically, you just have to add the directory that contains the swig executable the PATH environment variable. You can do it via CMD or the Windows UI.

If you have added swig to your path, you should be able to call it in the command prompt from any directory: open "cmd", and type swig --help" on that prompt.

A restart of PyCharm (or whatever your IDE is) and Windows might be required.

wp78de
  • 18,207
  • 7
  • 43
  • 71