wassimj / TopologicSverchok

Topologic custom nodes for sverchok on Blender3D
GNU Affero General Public License v3.0
83 stars 19 forks source link

Error upon installation #10

Closed Sinasta closed 2 years ago

Sinasta commented 3 years ago

Hello, thanks for your work. I'am getting this error when i try to install your addon on arch linux (manjaro). I am using python 3.9 and blender 3.0 with a system installation (means blender is using my systems python packages instead of its own).

Traceback (most recent call last): File "/usr/share/blender/3.0/scripts/modules/addon_utils.py", line 330, in enable importlib.reload(mod) File "/usr/lib/python3.9/importlib/init.py", line 169, in reload _bootstrap._exec(spec, module) File "", line 613, in _exec File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/init.py", line 40, in topologicEggName = '/'+[name for name in os.listdir(win_prefix+'/topologicPy/site-packages') if name.startswith('topologic')][0] FileNotFoundError: [Errno 2] No such file or directory: '/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/topologicPy/site-packages'

wassimj commented 3 years ago

Can you please tell me what files you have in

/home/sinasta/.config/blender/3.0/scripts/addons/

Sinasta commented 3 years ago

ls /home/sinasta/.config/blender/3.0/scripts/addons/
blenderbim gridmodeler pycache blender_ezdxf_exporter-main homemaker-addon-main slcad_transform BlenderGIS-master ifcsverchok sverchok-extra-master blender_node_capture-master isometric_cameras.py sverchok-master 'Construction Lines' ladybug_tools tissue-0-3-50 crowd_manager-main model_to_svg_full.py topologicsverchok-main Data-FX-master modular_tree vi-suite061-master data_vis neuralNetworPanel.py

wassimj commented 3 years ago

Can you then please check if the following folder exists /home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/topologicPy/site-packages

Sinasta commented 3 years ago

Sure. thanks for your help. the folder does not exist:

ls /home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main

examples LICENSE pycache topologicsverchok.zip init.py nodes README.md

Sinasta commented 3 years ago

my topologicpy is in: /usr/lib/python3.9/site-packages/topologic-0.5-py3.9.egg

wassimj commented 3 years ago

Right, then just copy the egg to /home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/topologicPy/site-packages

Sinasta commented 3 years ago

Thanks this worked somehow. But now i get this error when trying to activate:

Traceback (most recent call last): File "/usr/share/blender/3.0/scripts/modules/addon_utils.py", line 351, in enable mod = import(module_name) File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/init.py", line 244, in imported_modules = make_node_list() File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/init.py", line 239, in make_node_list module = importlib.import_module(f".{module_name}", base_name) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/nodes/Topologic/VertexByCoordinates.py", line 8, in faulthandler.enable() AttributeError: 'LogFile' object has no attribute 'fileno'

wassimj commented 3 years ago

Sorry not sure what this is. I will ask Linux experts.

brunopostle commented 3 years ago

There was a similar error caused by a bug in the last blenderbim release, what version of blenderbim have you installed? You may need to download it again.

Note that if you have managed to get the latest Homemaker add-on working, then you already have a working topologicPy, all you need is sverchok and the topologic-sverchok add-on. Check that you don't have conflicting versions installed.

An unexpected thing about the blender python interpreter is that it doesn't pick up libraries installed in ~/.local so python code needs to be installed system-wide or bundled with the add-on.

Sinasta commented 3 years ago

Thank you for your help! i installed the latest ifcopenshell release and updated to your latest homemaker release just in case. But i still get the same error.

wassimj commented 3 years ago

Please go into the addons folder of Blender then into topologicsverchok/nodes/Topologic and edit Vertex.byCoordinates.py and comment out around line 8 where it is calling faulthandler.

wassimj commented 3 years ago

To comment in python add a # at the start of the line

Sinasta commented 3 years ago

now i get this error:

Traceback (most recent call last): File "/usr/share/blender/3.0/scripts/modules/addon_utils.py", line 351, in enable mod = import(module_name) File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/init.py", line 244, in imported_modules = make_node_list() File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/init.py", line 239, in make_node_list module = importlib.import_module(f".{module_name}", base_name) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "/home/sinasta/.config/blender/3.0/scripts/addons/topologicsverchok-main/nodes/Topologic/EnergyModelByImportedOSM.py", line 6, in import openstudio ModuleNotFoundError: No module named 'openstudio'

wassimj commented 3 years ago

Yes. Please install openstudio using “pip install openstudio” and then copy the installed openstudio folder to the same addons folder next to BlenderBIM and topologicsverchok etc

Sinasta commented 3 years ago

Now it worked! thank you very much.

Sinasta commented 2 years ago

After the latest update i get this error when trying to activate topologic sverchok:

Traceback (most recent call last): File "/usr/share/blender/3.2/scripts/modules/addon_utils.py", line 351, in enable mod = import(module_name) File "/home/sinasta/.config/blender/3.2/scripts/addons/TopologicSverchok-main/init.py", line 56, in import topologic ImportError: generic_type: type "TopoDS_Shape" is already registered!

I tried deactivating my other addons but this didnt help. The import of topologic works though when done in python-console in the site-packages/topologic/ directory of the addon.

wassimj commented 2 years ago

Please tell me the version of topologic or the date of the ZIP file (latest is 2022-02-06) and please run the following script in the console and give me a screenshot on it:

from topologic import Vertex
v = Vertex.ByCoordinates(10,20,30)
print(v.X(), v.Y(), v.Z())

TopDS_Shape is the main OCCT shape that is also used by FreeCAD. So I suspect it is still a clash with FreeCAD. Also, make sure topologic is removed. Then make sure you restart Blender and install a fresh copy. I have seen the above error at times when you deactivate and then try to re-activate Topologic in the same session. If you deactivate Topologic, you have to quite Blender and restart it.

Sinasta commented 2 years ago

Thank you for your answer. The zip version is the lateste one (2022-02-06). I tried a new fresh install but it gives me the same error message. Topologic works well in the directory of topologic.so but in the blender console it doesnt. Screenshot from 2022-02-07 16-37-54 Screenshot from 2022-02-07 16-38-41 I supposed aswell the error coming from freecad being loaded as a dependency of sverchok but i deactivated freecad beeing loaded.

wassimj commented 2 years ago

Do you have homemaker installed and active by any chance?

brunopostle commented 2 years ago

[from a previous bug report] @sinasta is using the equivalent versions of Topologic and Homemaker.

Though for users who have the full version of Topologic Sverchok, there is a 'noarch' version of the Homemaker add-on that doesn't contain the duplicated libraries, and which avoids potential problems like this: https://github.com/brunopostle/homemaker-addon/releases

Sinasta commented 2 years ago

I indeed use Homemaker but i already tried and removed it. I don't really know what else could cause the interaction.

wassimj commented 2 years ago

ok. I will launch my Ubuntu partition and test it. @brunopostle can you test TopologicSverchok on your linux machine as well? Thanks! I know it works on Windows, but maybe I missed something on Linux. Will report back.

wassimj commented 2 years ago

Hi @Sinasta and @brunopostle. I just installed TopologicSverchok 0.7.0.2 on Linux Ubuntu 20.10 and Blender 3.0 with sverchok and I did not encounter any errors. Please see screenshot below.

I suggest you open the Blender scripts folder (e.g. ~/.config/blender/3.0/scripts/addons) and make sure you remove any references to Homemaker or Topologic (perhaps there is a previous version left over) and try again. If that works, then install the noarch version of Homemaker.

image

Sinasta commented 2 years ago

I tried a complete new install of topologic and topologicsverchok. I removed topologicsverchok and homemaker from blender( i veryfied in the addon folder) i uninstalled freecad(just in case). than i followed the procedure you explained here: https://github.com/wassimj/Topologic/issues/31 . I tried to install the topologic sverchok addon afterwards with the newly build topologic.so in the site-packages folder but still i got the same error. It might be worth noting that my blender version is 3.2, python 3.10.2, opencascade 7.5.3 and blenderbim 0.0.220209

Sinasta commented 2 years ago

i dont really know enough but is there maybe a way to check in the blender console what registered "TopoDS_Shape"?

Sinasta commented 2 years ago

i have some packages installed with pip to the blender/3.2/scripts/modules folder, they get loaded when blender starts:

pip list --path $HOME/.config/blender/3.2/scripts/modules Package Version


aiohttp 3.8.1 aiosignal 1.2.0 async-timeout 4.0.2 attrs 21.4.0 base58 2.1.1 bitarray 1.2.2 certifi 2021.10.8 charset-normalizer 2.0.11 circlify 0.14.0 click 7.1.2 colorama 0.4.4 commonmark 0.9.1 cycler 0.11.0 cytoolz 0.11.2 eth-abi 2.1.1 eth-account 0.5.7 eth-hash 0.3.2 eth-keyfile 0.5.1 eth-keys 0.3.4 eth-rlp 0.2.1 eth-typing 2.3.0 eth-utils 1.10.0 fonttools 4.29.0 frozenlist 1.3.0 geomdl 5.3.1 hexbytes 0.2.2 honeybee 0.1.0a4 honeybee-core 1.49.12 honeybee-energy 1.86.4 honeybee-radiance 1.52.4 honeybee-radiance-command 1.20.4 honeybee-radiance-folder 2.9.0 honeybee-schema 1.47.2 honeybee-standards 2.0.5 idna 3.3 imageio 2.14.1 interchange 2021.0.4 ipfshttpclient 0.8.0a2 jsonschema 3.2.0 kiwisolver 1.3.2 ladybug 0.0.2 ladybug-comfort 0.13.16 ladybug-core 0.39.41 ladybug-geometry 1.23.27 ladybug-geometry-polyskel 1.3.48 lbt-ladybug 0.25.119 llvmlite 0.38.0 lru-dict 1.1.7 matplotlib 3.5.1 meshio 5.3.0 monotonic 1.6 multiaddr 0.0.9 multidict 6.0.2 netaddr 0.8.0 networkx 2.6.3 numba 0.55.1 numpy 1.22.1 openstudio 3.3.0 packaging 21.3 pansi 2020.7.3 parsimonious 0.8.1 Pillow 9.0.0 protobuf 3.19.4 py-slvs 1.0.2 py2neo 2021.2.3 pycryptodome 3.14.0 pydantic 1.8.2 pydantic-openapi-helper 0.2.7 Pygments 2.11.2 PyMCubes 0.1.2 pyparsing 3.0.7 pyrsistent 0.18.1 python-dateutil 2.8.2 pytz 2021.3 pyvisgraph 0.2.1 PyWavelets 1.2.0 requests 2.27.1 rich 11.1.0 rlp 2.0.1 scikit-image 0.19.1 scipy 1.7.3 sdf 0.1 setuptools 60.8.2 setuptools-scm 6.4.2 six 1.16.0 tifffile 2021.11.2 tomli 2.0.1 toolz 0.11.2 typing-extensions 4.0.1 urllib3 1.26.8 varint 1.0.2 web3 5.26.0 websockets 9.1 wheel 0.37.1 yarl 1.7.2

Sinasta commented 2 years ago

this is the content of my blender/3.2/scripts/addons folder: blenderbim homemaker sverchok-master 'Construction Lines' ifcsverchok topologicsverchok data_vis ladybug_tools vi-suite07-master geometry_sketcher-main slcad_transform gridmodeler sverchok-extra-master

wassimj commented 2 years ago

Topologic is only compatible with opencascade 7.4.2. Please try the precompiled binaries rather than build it yourself https://github.com/wassimj/TopologicSverchok/releases

brunopostle commented 2 years ago

@Sinasta I think what you have done should work: if you have compiled Topologic with python 3.10.2 and opencascade 7.5.3 that are installed system wide, then you should be able to remove all the .so files in the Topologic-Sverchok add-on folder and replace them with the topologic.cpython-310-x86_64-linux-gnu.so file that you built yourself.

The "TopoDS_Shape is already registered" error suggests that you still have conflicting versions of Topologic installed somwhere.

wassimj commented 2 years ago

On Linux, Topologic.so files usually end up in /usr/local/lib. Perhaps you have a version installed there and it is conflicting with the one you are trying to use.

Sinasta commented 2 years ago

I have indeed some topologic files in /usr/local/lib: libTopologicCore.so libTopologicCore.so.0 libTopologicCore.so.0.0.0

and some in /usr/local/include/TopologicCore: About.h Dictionary.h PlanarSurface.h ApertureFactory.h DoubleAttribute.h ShellFactory.h Aperture.h EdgeFactory.h Shell.h Attribute.h Edge.h StringAttribute.h AttributeManager.h FaceFactory.h Surface.h Bitwise.h Face.h TopologicalQuery.h CellComplexFactory.h Geometry.h TopologyFactory.h CellComplex.h GlobalCluster.h TopologyFactoryManager.h CellFactory.h Graph.h Topology.h Cell.h InstanceGUIDManager.h Utilities ClusterFactory.h IntAttribute.h Utilities.h Cluster.h Line.h VertexFactory.h ContentManager.h ListAttribute.h Vertex.h Context.h NurbsCurve.h WireFactory.h ContextManager.h NurbsSurface.h Wire.h

But when i rename the 3 files in /usr/local/lib to *.bak topologic sverchok gives an error: ImportError: libTopologicCore.so.0: cannot open shared object file: No such file or directory

thats why i assumed they where important. My case might be different to others because i have manjaro linux (arch based) and blender is using my systems python(no bundled python).

brunopostle commented 2 years ago

@Sinasta that's ok, I'm using the blender 3.0 shipped with fedora that is linked with the system python 3.10.

You need the libTopologicCore.so* files in /usr/local/lib this is the non-python part of Topologic.

The .h files are not used at run-time.

The Topo_DS error implies that you have multiple versions of Topologic and/or opencascade somewhere.

wassimj commented 2 years ago

So if the conflict is not with the C++ libraries, but with the python bindings, find out if there is a second topologic python module installed in your system's python site-packages or dist-packages folder or similar. I suggest you issue the following command and then search the displayed folders to see if there is duplication:

python -m site and python -m site --user-site

Sinasta commented 2 years ago

I finally realised what was causing the issue. i thank both of you very much that you helped me even though it was clear that it was not a general issue. I have an addon installed which is called VI-suite. If you don't already know it than it is defenitly worth taking a look at. It uses Radiance, energy+ and openfoam to perform parametric environemental analysis (somehow similar to the ladybug suite). Anyways, for the airflow analysis it relies on openfoam which uses netgen to convert the mesh. Netgen seems to be causing the interaction in my case.

wassimj commented 2 years ago

That is quite the investigation! Glad you found it. Netgen seems to be using something similar to pythonocc (https://github.com/tpaviot/pythonocc)