Topologicpy install problems in Conda environment
Hi, I'm having troubles making run topologicpy on a conda enviroment. A did pip install it since there is apparently no conda-forge package available.
For some reason topologicpy is unable to load its own DLL dependencies
@topologic any advice on how should I proceed installation in Conda enviroment?
thanks
aitor
Comments
Hi @leceta
I just tried it on my computer and it worked just fine. Here is what I did step by step:
1. I started Anaconda
2. I activated a python 3.9 environment that I know does not have topologicpy (conda activate py39). Please note that topologicpy is compatible with python 3.7, 3.8, 3.9, and 3.10.
3. I started python in that environment
4. I tried import topologicpy. That failed as expected with _ModuleNotFound _as topologicpy was not installed
5. I quit python and went back to the command prompt still in the activated conda environment
6. I issued a pip install topologicpy (it installed version 0.0.25)
7. After installation was complete, I relaunched python
8. I issued the command from topologicpy.Vertex import Vertex. That worked.
9. I created a topologic vertex and printed its coordinates and that worked as well.
Please see the attached image as evidence:
Just a hunch: When these things have happened in the past, there usually is a different installation of OCCT with a different version than the one topologic uses and that is causing a problem.
Thank @topologic , please see the screen recording reproducing a strange behavior that "sometimes" makes importing fail

I'm working on a clean windows 11 installation on a VM, just with one python 3.9.16 running inside the conda enviroment. Topologicpy is 0.025 and ifcopenshell is 0.7.0
As I suspected. Ifcopenshell is probably using a different version of occt than topologicpy and thus it is conflicting.
I think I got a solution. What version of python are you using? For testing, can you use 3.10? I can send you a test version of topologicpy
I think this is solved. Can you please check the image below and let me know if this is what was not working for you? Thank you!

Hi @topologic , I make it work in both py3.9 and 3.10.

BUT, the "importing order" problem shown in the video start to happen when a new module is installed in the environment. The module is pythonocc-core. This happens with both python 3.9 and 3.10
I would be more than happy to test that "new" version of topologicpy to see if it can "stay happy" with pythonocc-core
saludos,
aitor
Please try this with py38, py39, py310 or py311. It is NOT compatible with py37.
https://cf-my.sharepoint.com/:u:/g/personal/jabiw_cardiff_ac_uk/ETuBu8JbGrtOt52MCJdeoHABgTnQLxSuTO9SrulkV-SFjA?e=BFgASf
it works!!!
Don't sound so surprised! ;-) Basically, the solution is in something called 'mangle' After you build the library, you run this algorithm to mangle the names of the DLLs and it makes sure topologic continues to point to them. This way, topologic no longer shares the same DLL names with anything else that uses occt.
A new version of topologicpy (0.1.1) has been released to pypi.org. You can install with pip install topologicpy --upgrade. This version is compatible with OCCT 7.7.0 for Windows and Linux and with python 3.8, 3.9, 3.10, and 3.11
https://pypi.org/project/topologicpy/0.1.1/
I would love for someone with Linux to test it out ( @brunopostle )
awesome Wassim, thanks!
Most welcome. Please share on social media any work you do with topologic. I am always curious what people use it for. Thanks!
sure, I have joined @agonzalezesteve 's team, I guess you already know his work in bim2bem
@leceta topologicpy version 0.1.4 and updated documentation has been released. It has awesome new features including Vertex.IsOnSameSide and OBJ import/export