Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest version doesn't seem to work in Windows with Python 2.7 #40

Closed
CPStagg opened this issue Nov 29, 2018 · 7 comments
Closed

Latest version doesn't seem to work in Windows with Python 2.7 #40

CPStagg opened this issue Nov 29, 2018 · 7 comments

Comments

@CPStagg
Copy link

CPStagg commented Nov 29, 2018

If I install from an old (2012) installer, I can run a simple test program with Python 2.7. However, if I remove that and install the most recent from the console using

python -m pip install pyswip

...the package seems to be put in place correctly but the program no longer runs:

File "C:\Python27\lib\site-packages\pyswip\prolog.py", line 111, in call
t = getTerm(swipl_list)
File "C:\Python27\lib\site-packages\pyswip\easy.py", line 404, in getTerm
res = getList(t)
File "C:\Python27\lib\site-packages\pyswip\easy.py", line 420, in getList
result.append(getTerm(head))
File "C:\Python27\lib\site-packages\pyswip\easy.py", line 406, in getTerm
res = getFunctor(t)
File "C:\Python27\lib\site-packages\pyswip\easy.py", line 429, in getFunctor
return Functor.fromTerm(t)
File "C:\Python27\lib\site-packages\pyswip\easy.py", line 241, in fromTerm
raise ArgumentTypeError((str(Term), str(int)), str(type(term)))
pyswip.easy.ArgumentTypeError: Expected an argument of type '("<class 'pyswip.easy.Term'>", "<type 'int'>")' but got '<type 'long'>'

Did I somehow bugger things up by leaving something in place from the original install? (If I switch again by removing the newer version and then executing the old installer again, it works.)

EDIT: Repro'd the same problem on a different machine, this time without having initially used the installer exe.

@CPStagg CPStagg changed the title Latest version doesn't seem to work with Python 2.7 Latest version doesn't seem to work in Windows with Python 2.7 Nov 29, 2018
@yuce
Copy link
Owner

yuce commented Dec 8, 2018

Can you paste a sample program that produces this issue?

@CPStagg
Copy link
Author

CPStagg commented Dec 8, 2018

The code I posted on this thread should do the job:

#3

@yuce
Copy link
Owner

yuce commented Dec 8, 2018

It's best to paste the smallest code that reproduces the issue. Can you run this in your python console and paste the result?

import pyswip; print(pyswip.__VERSION__)

@CPStagg
Copy link
Author

CPStagg commented Dec 9, 2018

Don't have access to my work PC where I had installed from the command line above. Just tried at home (after same error) and got
0.2.7

But am not 100% sure of the installation method I used for that.
EDIT: Just uninstalled, reinstalled, still 0.2.7, still fails to run the python program as above.
EDIT2: Tried to repeat in python3, gives 0.2.7, program runs successfully as before

@pattoM
Copy link

pattoM commented Dec 12, 2018

The error is from the inconsistency between 64 bit and 32 bit systems and their use of int or long. To avoid the error stick to 32 bit or 64 bit across your python and prolog installation. At least that is what resolved the error for me

@eastalent
Copy link

I met the same problem, but when I make the path of the pl file shorter, it won't have any problems

@yuce
Copy link
Owner

yuce commented Jul 14, 2019

Closing the issue since @pattoM's solution seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants