no SConstruct file found

Asked by HaodingXu

Hi, sir,
It is my first time to use escript and scons. I am trying to run: (location is /usr/lib/python3-escript/esys/escript)

scons j1 options_file=scons/templates/focus_options.py

it shows

scons: *** No sconstruct file found.
File '/usr/lib/python3/dist-packages/SCons/script/main.py', line947, in _main

I have installed escript suing "sudo apt install python3-escript" (version 5.6 -4build1)
scons is 4.0.1.
I didn't see templates file in scons.

Did I do anything wrong?

Best wishes
haoding

Question information

Language:
English Edit question
Status:
Solved
For:
esys-escript Edit question
Assignee:
No assignee Edit question
Solved by:
Adam Ellery
Solved:
Last query:
Last reply:
Revision history for this message
Adam Ellery (aellery) said :
#1

HI haoding,

If you installed escript from the repository then there is no need to compile it from source code.

best wishes,
adam

Revision history for this message
HaodingXu (haoding) said :
#2

Dear Adam,

Thank you for your reply.

I used the code " sudo apt install python3-escript" to install.

I just tried to import it in python3 with:
"python3
from esys.escript import *"

but got an error: "no module named 'esys'"

Can you give me some advice?

Bestw wishes,
Haoding

Revision history for this message
HaodingXu (haoding) said :
#3

Dear Adam,

Thank you for your reply.

I used the code " sudo apt install python3-escript" to install.

I just tried to import it in python3 with:
"python3
from esys.escript import *"

but got an error: "no module named 'esys'"

Can you give me some advice?

Bestw wishes,
Haoding

Revision history for this message
Adam Ellery (aellery) said :
#4

Hi Haoding,

What Linux distro are you currently using?

Best wishes,
Adam

Revision history for this message
HaodingXu (haoding) said :
#5

Dear Adam,

I am suing ubuntu 22.04, with python 3.10.4.
And I have already install escript.

here is the error:

haodingxu@haodingxu-HP-EliteBook-840-G5:~$ python3
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from esys.escript import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'esys'

but if I try with this it seems work:

haodingxu@haodingxu-HP-EliteBook-840-G5:~$ run-escript3
Python 3.10.4 (main, Apr 2 2022, 09:04:19) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from esys.escript import *
/usr/lib/python3-escript/esys/escriptcore/symbolic/evaluator.py:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.version as duv
>>> import distutils.version as duv

1. is there any way to directly use escript in python?
2. what should I do with the 'import distutils.version as duv' or 'he distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives'?

if you can give me some help I will be very thankful!

Best wishes,
Haoding

Revision history for this message
Best Adam Ellery (aellery) said :
#6

Hi Haoding,

You should be able to launch a python session with escript enabled using the command:

run-escript

Alternatively, you can modify you environment using the commands

export LD_LIBRARY_PATH=/usr/lib/python3-escript/lib:$LD_LIBRARY_PATH
export PYTHONPATH=/usr/lib/python3-escript:$PYTHONPATH

Then run the command:

python3

Best wishes,
Adam

Revision history for this message
HaodingXu (haoding) said :
#7

It works!
should I focus on the DeprecationWarning

Thank you very much!!!

Revision history for this message
HaodingXu (haoding) said :
#8

Thanks Adam Ellery, that solved my question.