- Thank you received: 31
Build from source on Windows
4 years 4 months ago #2924
by matthiash
Replied by matthiash on topic Build from source on Windows
What happens when you do following?
python -c 'import ngsolve'
echo %PYTHONPATH%
Best,
Matthias
python -c 'import ngsolve'
echo %PYTHONPATH%
Best,
Matthias
4 years 4 months ago #2927
by ddrake
Replied by ddrake on topic Build from source on Windows
I think the issue may be that the PYTHONPATH did not get sourced in the 'git bash' mingw shell I used to do the build. Maybe if I closed and re-opened the shell after doing
but before doing the install step it would work? I can try that.
In the mingw shell I used to perform the (failed) build, if I cd to my home directory:
If I go back to the build directory and try, I get
So the import succeeds. If I do
(doesn't have ngsolve).
Now if I open a new 'git bash' shell, I see
so the environment variable is set, but in that same shell,
unless I cd to the build directory.
I see this same behavior if I open a regular command terminal
Best,
Dow
Code:
cmake --build . --config Release --target set_environment_variables
In the mingw shell I used to perform the (failed) build, if I cd to my home directory:
Code:
$ pwd
/c/Users/Dow
$ python -c 'import ngsolve'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ngsolve'
Code:
$ cd ngsuite/build
$ pwd
/c/Users/Dow/ngsuite/build
$ python -c 'import ngsolve'
Code:
$ echo $PYTHONPATH
C:\Users\Dow;C:\Users\Dow\python;
Now if I open a new 'git bash' shell, I see
Code:
$ echo $PYTHONPATH
C:\Users\Dow\ngsuite\install\;C:\Users\Dow;C:\Users\Dow\python;
Code:
$ python -c 'import ngsolve'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ngsolve'
I see this same behavior if I open a regular command terminal
Code:
C:\Users\Dow>python -c "import ngsolve"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'ngsolve'
C:\Users\Dow>cd ngsuite/build
C:\Users\Dow\ngsuite\build>python -c "import ngsolve"
C:\Users\Dow\ngsuite\build>echo %PYTHONPATH%
C:\Users\Dow\ngsuite\install\;C:\Users\Dow;C:\Users\Dow\python;
Best,
Dow
4 years 4 months ago #2929
by ddrake
Best,
Dow
Replied by ddrake on topic Build from source on Windows
I tried this just now, but got the same error in the install stepMaybe if I closed and re-opened the shell after doing
cmake --build . --config Release --target set_environment_variables
but before doing the install step it would work? I can try that.
Best,
Dow
4 years 4 months ago #2930
by matthiash
Replied by matthiash on topic Build from source on Windows
Hi Dow,
In your case, PYTHONPATH should have the value
C:/UsersDow/ngsuite/install/Lib/site-packages
This is where the python packages/modules are installed. (See the output.txt you sent).
I will test on Windows if there is an issue with the set_environment_variables target in
CMake.
Best,
Matthias
In your case, PYTHONPATH should have the value
C:/UsersDow/ngsuite/install/Lib/site-packages
This is where the python packages/modules are installed. (See the output.txt you sent).
I will test on Windows if there is an issue with the set_environment_variables target in
CMake.
Best,
Matthias
4 years 4 months ago #2935
by matthiash
Replied by matthiash on topic Build from source on Windows
Hi Dow,
I just tried it on Windows and it seems there is a problem with Python 3.8 (might be releated to Tcl/Tk).
Please downgrade to Python 3.7 and try again.
Best,
Matthias
I just tried it on Windows and it seems there is a problem with Python 3.8 (might be releated to Tcl/Tk).
Please downgrade to Python 3.7 and try again.
Best,
Matthias
The following user(s) said Thank You: ddrake
4 years 4 months ago #2936
by ddrake
Replied by ddrake on topic Build from source on Windows
Thanks, Matthias! Downgrading to Python 3.7 eliminated the build error.
Then to get things working, I just had to
add %NETGENDIR% to my path and
add C:\Users\dow\ngsuite\install\lib\site-packages to my PYTHONPATH
Best,
Dow
Then to get things working, I just had to
add %NETGENDIR% to my path and
add C:\Users\dow\ngsuite\install\lib\site-packages to my PYTHONPATH
Best,
Dow
Time to create page: 0.118 seconds