compas-dev / compas-dev/compas_ifc

Installation fails on Windows with Python 3.13/3.12 due to multiple compatibility issues

Open
#14 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
26
Forks
5
PR merge metrics
No merged PRs in 30d

Description

## Environment
- OS: Windows 11
- Python: 3.12 (via conda-forge)
- compas_ifc: 0.5.0 (pip) / 1.7.0 (local)
- ifcopenshell: 0.8.5
- PySide6: 6.8.3

## Problems found

### 1. pip installs outdated version (0.5.0)
`pip install compas_ifc` installs 0.5.0 instead of latest because
`requirements.txt` pins `ifcopenshell==0.7.0.240406` which does not exist on PyPI.

**Fix:** Change `requirements.txt`:
ifcopenshell==0.7.0.240406 → ifcopenshell>=0.8.4

### 2. AttributeError: 'tuple' object has no attribute 'data' (compas_ifc 0.5.0)
`shape.transformation.matrix.data` fails because ifcopenshell 0.8.x
returns a tuple instead of an object with `.data`.

### 3. Matrix reshape error (compas_ifc 1.7.0, file.py line 322)
ifcopenshell 0.8.x returns a 4x4 matrix (16 values) instead of 4x3 (12 values).
`np.array(matrix).reshape((4, 3))` fails with ValueError.

**Fix:**
```python
matrix = np.array(matrix)
if matrix.size == 12:
matrix = matrix.reshape((4, 3))
matrix = np.hstack([matrix, np.array([[0], [0], [0], [1]])])
matrix = matrix.transpose()
elif matrix.size == 16:
matrix = matrix.reshape((4, 4))
matrix = matrix.transpose()
```

### 4. material.diffuse API change (file.py line 340)
`(*material.diffuse, ...)` fails because diffuse is now a `colour` object.

**Fix:**
```python
d = material.diffuse
color = (d.r, d.g, d.b, 1 - material.transparency)
```

### 5. Qt platform plugin "windows" not found
PySide6 >= 6.10 (required for Python 3.13) has DLL issues on Windows.
Solution: Use Python 3.12 with PySide6==6.8.3

**Workaround:**
```bash
$env:QT_QPA_PLATFORM_PLUGIN_PATH = "...\envs\bim\Lib\site-packages\PySide6\plugins\platforms"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.