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

Running csp_single.py fails #12

Closed
cprudhom opened this issue Sep 23, 2020 · 1 comment
Closed

Running csp_single.py fails #12

cprudhom opened this issue Sep 23, 2020 · 1 comment

Comments

@cprudhom
Copy link
Collaborator

I tried to run PyCSP3/pycsp3/problems/tests/cop_acad.py and got the following trace (and error):


|================================================================|
  Python: python3 (Python 3.7.1)
  Name: BoardColoration
  Data: [8,10]
  Name XML: BoardColoration-8-10.xml
|================================================================|
Command: python3 ./pycsp3/problems/cop/academic/BoardColoration.py -data=[8,10]
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 557, in move
    os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: 'BoardColoration-8-10.xml' -> './pycsp3/problems/tests/tmp/cop/academic/PyCSP/BoardColoration-8-10.xml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/kyzrsoze/Sources/PyCSP3/pycsp3/problems/tests/cop_acad.py", line 25, in <module>
    .add("WaterBucket", data="[8,5,3,4,4,0,8]")  # optimum 7
  File "/Users/kyzrsoze/Sources/PyCSP3/pycsp3/problems/tests/tester.py", line 40, in run
    xcsp.load(mode=2)
  File "/Users/kyzrsoze/Sources/PyCSP3/pycsp3/problems/tests/tester.py", line 218, in load
    shutil.move(self.name_xml, self.xml_path_py())
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 571, in move
    copy_function(src, real_dst)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 257, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'BoardColoration-8-10.xml'

PyCSP stderr : 
/Library/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python: can't open file './pycsp3/problems/cop/academic/BoardColoration.py': [Errno 2] No such file or directory


Process finished with exit code 1

Do you have any idea how I can fix that?
In addition, I would appreciate if I could set the solver in __init__() of Tester.

Thank you

@xcsp3team
Copy link
Owner

This is fixed. Please, check that you can now run: python3 PyCSP3/pycsp3/problems/tests/cop_acad.py
(I assume, when looking at your message that your first directory is PyCSP3)

The problem was that you needed to be in the root parent of pycsp3 to run the file.
Now, you can run cop_acad.py from any directory

Note that these tests are for checking that the output of the compiler is still the same

@cprudhom cprudhom closed this as completed Oct 2, 2020
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

2 participants