0

am using pyclips to generate the facts a nd rules of my system .. i have download every requirements for installing pyclips which include a clips directory that contatins the python files necessary for using clips inside the python code ..

but when i write " import clips " or " import pyclips.clips" the error " " no module named clips " appear!!

so please clould any one help me to make the import correct?

just i wanna say that i put the folder pyclips insode the libraries folder in the python folder in c:/

Amittai Shapira
  • 3,749
  • 1
  • 30
  • 54
shaimaa
  • 1
  • 1
  • 2
  • If there's a setup.py file, try running "python setup.py install" (or whatever the equivalent on Windows is). Or try copying the "clips" (not pyclips) folder into the libraries folder. – Thomas K May 21 '11 at 14:12
  • aha yes, the equivalent on windows is just to double click on the setup.py and that what i actually did, and as a result the CLIPSSrc package installed. now i put the clips file in the lib folder in the python and i still get the same result! – shaimaa May 22 '11 at 07:18
  • IDLE 2.6.2 >>> import clips Traceback (most recent call last): File "", line 1, in import clips File "C:\Python26\lib\clips\__init__.py", line 36, in from _clips_wrap import * File "C:\Python26\lib\clips\_clips_wrap.py", line 37, in import _clips as _c ImportError: No module named _clips >>> – shaimaa May 22 '11 at 07:20

3 Answers3

1
PYTHONPATH="/Library/Python/2.7/site-packages/clips/"
export PYTHONPATH
Druid
  • 6,423
  • 4
  • 41
  • 56
Bemis
  • 3,092
  • 2
  • 17
  • 24
0

You can't double click the setup.py file.
First you change current dir to place which the setup.py file.
Second use command setup.py install.

You do about all, that's ok.

e.g: 

C:\Windows\System32>F:

F:\>cd F:\Downloads\pyclips-1.0.7.348\pyclips

F:\Downloads\pyclips-1.0.7.348\pyclips>setup.py install
Mark
  • 1
  • 1
0

After the CLIPSSrc package is built, follow Mark's answer.

If on running 'import clips' in a subsequent python prompt still throws the same error that means either the clips module failed to build or the clips module is not in the python path.

You can put the clips module in in the python path by:

import sys
sys.path.append('C:\PATH\TO\clips\module\clips') # Whatever path the clips module is

Now, 'import clips' should work.

PoorLuzer
  • 24,466
  • 7
  • 31
  • 35