2

I installed Python 3.6.3 64bit through Anaconda on my 64bit Win10. And I installed Netgen 64bit from the official sourceforge page. But when I try to run Negen I get the error:

The code execution cannot proceed because python35.dll was not found. Reinstalling the program may fix this issue.

enter image description here

  1. I tried reinstalling but it did not help
  2. I checked I have installed everything in 64bit and my python is also 64
  3. I'm pretty sure my python is added to the PATH, when I run python in the command line it opens the python shell.
  4. there are similar posts suggesting to download the missing .dll from the internet. I don't think that's such a good idea.

I would appreciate if you could help me know what is the problem and how I can solve it?

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193
  • 1
    Which *specific* Python 3.x release did you install? – Charles Duffy Nov 22 '17 at 00:57
  • @CharlesDuffy 3.6.3 also added to the OP – Foad S. Farimani Nov 22 '17 at 00:58
  • 1
    There's your problem -- your Netgen installer is built for Python 3.5, you installed Python 3.6. You either need a newer build of Netgen (if one doesn't exist, to run one yourself), or to use an older Python. – Charles Duffy Nov 22 '17 at 00:58
  • @CharlesDuffy so what should do? should I downgrade my python? any other workaround? – Foad S. Farimani Nov 22 '17 at 00:59
  • 1
    No other workaround, no -- only point releases, not minor releases, are binary-compatible. You can downgrade your Python, you can look for a newer Netgen build, you can -- potentially, given the source and an appropriate build toolchain -- run a newer build yourself. – Charles Duffy Nov 22 '17 at 01:00
  • 1
    Mind you, you can have Python 3.5 and 3.6 both installed at the same time, so "downgrade" isn't necessarily mandatory as such. – Charles Duffy Nov 22 '17 at 01:00
  • I'm not sure how can I build the netgen source with a newer version of python maybe you can give me the instructions? installing both pythons is also possible. I guess I have to remove newer python from PATH and then install the older one and add it to the path? – Foad S. Farimani Nov 22 '17 at 01:02
  • 1
    No, you don't need to remove the new one from the PATH. And instructions for compiling 3rd-party software are a bit out-of-scope here. – Charles Duffy Nov 22 '17 at 01:03
  • @CharlesDuffy so you say it is theoretically possible to build Netgen with newer python, given the source code? – Foad S. Farimani Nov 22 '17 at 01:06
  • 1
    Correct, it is theoretically possible to build Netgen with newer Python, given the source code. – Charles Duffy Nov 22 '17 at 01:06
  • @CharlesDuffy where is the proper place to ask for build instructions? – Foad S. Farimani Nov 22 '17 at 01:07
  • 1
    The mailing list for the Netgen project, if they don't already have documentation in the source tree (and if they aren't already compatible with the standardized setuptools/distutils-based compilation procedure). – Charles Duffy Nov 22 '17 at 01:08
  • 1
    See https://docs.python.org/2/extending/building.html re: said standardized procedure, if they *do* have a `setup.py` that tries to support it. It's acceptable to ask questions here if you've tried to follow those steps and hit problems, not if you haven't tried yet. – Charles Duffy Nov 22 '17 at 01:09
  • @CharlesDuffy I emailed the developers reported the issue. They don't have a mailing that I know of and the bug report in Sourceforge needs admin authorization! Thanks for your help. I appreciate your patience and kindness. – Foad S. Farimani Nov 22 '17 at 01:18
  • Glad to help. BTW, if you do want to try compiling yourself, also see https://wiki.python.org/moin/WindowsCompilers describing which compiler versions you need to build native C modules for Python -- for Python 3.6, you'll need Visual Studio 14.0. – Charles Duffy Nov 22 '17 at 02:15

5 Answers5

1

Python 3.6.x does not provide python35.dll.

Install a Python 3.5 interpreter.

Charles Duffy
  • 280,126
  • 43
  • 390
  • 441
  • 1. which python 3.5.x should I install? 2. Does it mess up my original install? 3. should I remove the original install from PATH and add the 3.5.x? – Foad S. Farimani Nov 22 '17 at 01:05
  • 1
    1. Any -- so typically the newest. 2. No. 3. You don't need to remove your original install; the installer should add the new one. – Charles Duffy Nov 22 '17 at 01:06
  • 1
    Related: https://stackoverflow.com/questions/4583367/how-to-run-multiple-python-versions-on-windows – Charles Duffy Nov 22 '17 at 01:07
1

Latest Netgen releases are available from http://www.ngsolve.org
They use Python 3.6

0

I had the same problem, but in my case netgen could not find python37.dll , and I had Python 3.9 . Eventually I renamed python39.dll to python37.dll, netgen called me names ("use of python37.dll conflicts with this version of Python"), but started to work.

akhmeteli
  • 101
0

just edit environment variables to add path to python37.dll which is generally in C:\Users\YOURNAME\AppData\Local\Programs\Python

Sagar Darekar
  • 982
  • 9
  • 14
Said
  • 1
0

This is an old thread, but I thought I would add the brute-force solution that worked.

The issue for me was that I cannot 'install' the older python 3.7, it messes with all my recent python 3.11 coding/work. I can't have it in my Path either.

So what I did: I downloaded the python-3.7.9-embed-amd64.zip

and just unzipped all the files into the main Ngsolve \bin\ folder, such as:

C:\Program Files\ngsolve-v6.2.2301\bin\

Netgen then runs. Brute force, but does work for anyone trying to get around the "python 3.7 dll not found" issue.

hope this is helpful.