Hello,
I try to use SconePy libraries to utilize the Scone engine with Python.
However, I could not compile any of the Python codes of the Scone project (e.g., sconegym, depRL, and even sconepy_example.py) just because the prompt could not find the sconepy modules (the error message is "ModuleNotFoundError: No module named 'sconepy'").
According to the documentation (https://scone.software/doku.php?id=sconepy), the only procedure required should be just installing SCONE.
I assumed that some required protocols to activate Scone's Python API (e.g., making a path) could be automatically completed after installation, but it seems they are not.
Could you tell me how I can activate API modules?
I'm using Windows OS.
Thank you in advance for your help.
failure to find sconepy modules in python
- Akito Fukunishi
- Posts: 3
- Joined: Tue Nov 03, 2020 10:29 pm
- Thomas Geijtenbeek
- Posts: 439
- Joined: Wed Mar 12, 2014 8:08 am
Re: failure to find sconepy modules in python
The path of the SconePy module should automatically be detected in sconetools.py, but this only works if:
- SCONE is installed in the default folder (C:\Program Files\SCONE)
- You are using Python version 3.9
- Akito Fukunishi
- Posts: 3
- Joined: Tue Nov 03, 2020 10:29 pm
Re: failure to find sconepy modules in python
Thank you for fast reply.
The reason why I could not import the module is certainly the location of SCONE folder.
Following your suggestion, adding the path to the SCONE\bin manually by modifying the code of sconetools.py works!
The reason why I could not import the module is certainly the location of SCONE folder.
Following your suggestion, adding the path to the SCONE\bin manually by modifying the code of sconetools.py works!
- Nilay Khare
- Posts: 6
- Joined: Sat Jun 01, 2024 2:07 am
Re: failure to find sconepy modules in python
I am facing the same issue, however, the path seems correct for Sconepy module.
I have installed scone at default location. C:\Program Files\SCONE. and path to sconepy.cp39-win_amd64.pyd is C:\Program Files\SCONE\bin.
However, the path for sconepy_example.py is different from that of the document. It is at C:\Program Files\SCONE\scone\scenarios\SconePy. when I am running it. receiving following output-
_________________________________
sconepy found at C:/Program Files/SCONE/bin
Traceback (most recent call last):
File "C:\Program Files\SCONE\scone\scenarios\SconePy\sconepy_example.py", line 3, in <module>
from sconetools import sconepy
File "C:\Program Files\SCONE\scone\scenarios\SconePy\sconetools.py", line 49, in <module>
import sconepy
ModuleNotFoundError: No module named 'sconepy'
_______________________________________________-
I have installed scone at default location. C:\Program Files\SCONE. and path to sconepy.cp39-win_amd64.pyd is C:\Program Files\SCONE\bin.
However, the path for sconepy_example.py is different from that of the document. It is at C:\Program Files\SCONE\scone\scenarios\SconePy. when I am running it. receiving following output-
_________________________________
sconepy found at C:/Program Files/SCONE/bin
Traceback (most recent call last):
File "C:\Program Files\SCONE\scone\scenarios\SconePy\sconepy_example.py", line 3, in <module>
from sconetools import sconepy
File "C:\Program Files\SCONE\scone\scenarios\SconePy\sconetools.py", line 49, in <module>
import sconepy
ModuleNotFoundError: No module named 'sconepy'
_______________________________________________-
- Thomas Geijtenbeek
- Posts: 439
- Joined: Wed Mar 12, 2014 8:08 am
Re: failure to find sconepy modules in python
The sconepy_example.py should be installed in your Windows Documents folder, in the SCONE subfolder. Is this not the case?
You should not run the sconepy_example.py directly from the Program Files folder.
You should not run the sconepy_example.py directly from the Program Files folder.
- Nilay Khare
- Posts: 6
- Joined: Sat Jun 01, 2024 2:07 am
Re: failure to find sconepy modules in python
Thanks for the quick response. Yes, later I realized it. I tried to run it with the scone folder in documents, but it still shows the same error.
sconepy found at C:/Program Files/SCONE/bin
Traceback (most recent call last):
File "C:\Users\nilay\Documents\SCONE\SconePy\sconepy_example.py", line 3, in <module>
from sconetools import sconepy
File "C:\Users\nilay\Documents\SCONE\SconePy\sconetools.py", line 49, in <module>
import sconepy
ModuleNotFoundError: No module named 'sconepy'
sconepy found at C:/Program Files/SCONE/bin
Traceback (most recent call last):
File "C:\Users\nilay\Documents\SCONE\SconePy\sconepy_example.py", line 3, in <module>
from sconetools import sconepy
File "C:\Users\nilay\Documents\SCONE\SconePy\sconetools.py", line 49, in <module>
import sconepy
ModuleNotFoundError: No module named 'sconepy'
- Thomas Geijtenbeek
- Posts: 439
- Joined: Wed Mar 12, 2014 8:08 am
Re: failure to find sconepy modules in python
Are you using the correct Python version (3.9)?
- Nilay Khare
- Posts: 6
- Joined: Sat Jun 01, 2024 2:07 am
Re: failure to find sconepy modules in python
I checked the Python interpreter version as per your suggestion and found it was incorrect. Switching to version 3.9 resolved the issue. Thank you!