The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Discussions about using GRAPHISOFT's tools (API DevKit) for independent software developers

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, rmasaki, MOREH Tamas, Akos Somorjai, Ed Brown, Mihály Palenik, Tibor Lorántfy

#314433
Archicad has a problem when you have Python installed via Anaconda/Miniconda.
It either reports error R6034 (which can be mitigated by renaming all "msvcr90.dll" files inside the *conda folder).
But afterwards, if you open the Python palette the search for an interpreter just stucks inside a loop, where it never finds one. What is even more funnier, because GS themself proposes to use Anaconda/Miniconda.

You can stop the ongoing search loop, but then the Python palette is worthless, since you can't use it. Not so dramatic either, since you can do everything in VSCode as well.
BUT if you try to close Archicad in the end: you can't! The files closes, but AC refuses to go away and has to be sniped from orbit with the taskmanager...

So, please either fix this, GS, or just let the user help and point to the right interpreter... :?
#314477
Although not a in a very user friendly way, but there is an option to set a custom location for your Python interpreter.

You can set the PythonUI/CustomLocation (String Value) registy key to the location of the interpreter.

Hope it helps,
Viktor
#314485
Viktor Kovacs wrote:
Mon Aug 03, 2020 9:17 am
You can set the PythonUI/CustomLocation (String Value) registy key to the location of the interpreter.
Hey Viktor, thank you for this info!
Where exactly in registry shall this key be, tho? The regedit search didn't found it, and looking by hand it's definitely not in Computer\HKEY_CURRENT_USER\Software\GRAPHISOFT\

So what I did instead was making a new key named "PythonUI" inside of Computer\HKEY_CURRENT_USER\Software\GRAPHISOFT\ARCHICAD\ARCHICAD 24.0.0 GER R1\
And then a new string value named "CustomLocation" set to the path to the custom Python interpreter.

This however didn't work out, either.... :?
#314565
Hi,

Thank you very much for reporting the issue, and I am very sorry about the experience!

I tried to replicate the issue, by removing any trace of Python in my computer. After that, I download the latest Anaconda installer (2020.7) from their website and install it. Upon checking in Archicad, the interpreter is loaded correctly, there was no constant loop or error message appear (as can be seen in the attached screenshot below).

Could you let me know at which point did you encounter the error R6034?

Thank you very much!

Best regards,
Minh
Attachments
anaconda - python palette.png
#314579
Hi Minh!
Thank you so much for replying!

The R6034 error shouldn't actually matter. It is a well known problem, because there can be only one msvcr90.dll loaded at any time. Also the renaming helped with that and you don't need that dll anyway.

Since you had a nice and clean new install I think your default environment is already Python 3.x.
I did a lot of work on IronPython previously and I have an older install of Miniconda so my default environment is actually 2.7 – and Py3 is in a virtual env (because that's the reason to use Miniconda: the ability to have more than one Python version installed).
So it seems Archicad has problems finding the virtual env interpreter then, huh?

Do you know about the registry item? Maybe if you or Viktor can shine a bit more light on it I'm still able to use my current install.
It is also a bit dumb with *conda, because while you can install as many Python versions as you want, it doesn't support changing the default Python.... :?
So yeah, maybe I still need to reinstall everything. Or maybe Pipenv is a good alternative....?
#314645
Hi,

Thank you very much for the clarification! I never have more than one Python environment installed, therefore I never encountered such errors. Let me ask for some help from the development team with this issue. As soon as I have an answer, I will get back to you!

Best regards,
Minh
#314834
runxel wrote:
Mon Aug 03, 2020 12:23 pm
Viktor Kovacs wrote:
Mon Aug 03, 2020 9:17 am
You can set the PythonUI/CustomLocation (String Value) registy key to the location of the interpreter.
So what I did instead was making a new key named "PythonUI" inside of Computer\HKEY_CURRENT_USER\Software\GRAPHISOFT\ARCHICAD\ARCHICAD 24.0.0 GER R1\
And then a new string value named "CustomLocation" set to the path to the custom Python interpreter.

This however didn't work out, either.... :?
Hi,

The registry key should be created and set manually, so you did well.
I attached a screenshot from my registry and the python versions found by the Python Palette. In the Python Options dialog you can activate the desired python environment.
PythonUI_CustomLocation_Registry.png
#314838
Tibor Lorántfy wrote:
Mon Aug 10, 2020 10:42 am
The registry key should be created and set manually, so you did well.

Hi Tibor, thank you so much for clarification!
However I now see that there is a difference between what I want to achieve and what this technique can offer.
See, if one opens the Python palette, AC will try to find an Archicad interpreter but fails to do so. That's when I thought the registry key could help. But after you click on "abort the search" the palette opens like this (see attached image).
Seems like the registry key only helps, if AC already found an interpreter, otherwise it doesn't work – which is quite useless in a case like mine...
Attachments
pypal.png
pypal.png (12.89 KiB) Viewed 53 times
#314842
runxel wrote:
Mon Aug 10, 2020 11:06 am
Seems like the registry key only helps, if AC already found an interpreter, otherwise it doesn't work – which is quite useless in a case like mine...
Thank you for pointing out this issue!
You're absolutely right. I added this to our bug database: DEF-1519 (PythonUI/CustomLocation registry key only helps if AC already found an interpreter)

Until we fix the bug, as a workaround I would suggest you to add at least one python interpreter path to the PATH environment variable. That way Archicad will be able to find an interpreter and you will be able to open Python Options to select the interpreter.
#314845
Tibor Lorántfy wrote:
Mon Aug 10, 2020 11:47 am
Thank you for pointing out this issue!
You're absolutely right. I added this to our bug database
Great! Thanks again, Tibor! :)
For now I just use my Python from VSCode directly, which works like a charm.