[Python] import cadquery

import cadquery
Traceback (most recent call last):
File “”, line 1, in
File “/nix/store/j5kki2qzj0svbhs5pw0fj0wydphl115w-python3-3.7.5-env/lib/python3.7/site-packages/cadquery/ init .py”, line 2, in
from .occ_impl.geom import Plane, BoundBox, Vector, Matrix
File “/nix/store/j5kki2qzj0svbhs5pw0fj0wydphl115w-python3-3.7.5-env/lib/python3.7/site-packages/cadquery/occ_impl/geom.py”, line 3, in
from OCC.Core.gp import gp_Vec, gp_Ax1, gp_Ax3, gp_Pnt, gp_Dir, gp_Trsf, gp, gp_XYZ
ModuleNotFoundError: No module named ‘OCC.Core’

--------------------------- cadquery default.nix

https://github.com/marcus7070/nixpkgs/blob/2c909542f778d44386e9c6b78e2759b30e0429b1/pkgs/development/python-modules/cadquery/default.nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pyparsing
, opencascade
, stdenv
, python
, cmake
, swig
, ninja
, smesh
, freetype
, libGL
, libGLU
, libX11
, six
, appdirs

, pythonocc-core # I use pythonocc-core 0.18.1 (Same with version 0.18.2)
}:

buildPythonPackage rec {
pname = “cadquery”;
version = “2.0RC0”;

src = fetchFromGitHub {
owner = “CadQuery”;
repo = pname;
rev = version;
sha256 = “1xgd00rih0gjcnlrf9s6r5a7ypjkzgf2xij2b6436i76h89wmir3”;
};

buildInputs = [
opencascade
];

propagatedBuildInputs = [
pyparsing
pythonocc-core
];
doCheck = false;
meta = with lib; {
description = “Parametric scripting language for creating and traversing CAD models”;
homepage = GitHub - CadQuery/cadquery: A python parametric CAD scripting framework based on OCCT;
license = licenses.asl20;
maintainers = [ maintainers.costrouc maintainers.marcus7070 ];
};
}