Hello,
I am very new to Nix and NixOS since my first install 2024-03-15 19:52. I am learning how to create a development environment for build123d, a Python based CAD API. A few days have passed and the struggle continues . . . I almost have it (I think).
If you can, please review what I have done, help me get it working, and give me some suggestions. Also, I don’t know Haskell, JSON, or Nix . . . so if you can clue me into what some of the common and best practices are. Thanks for sharing your time.
Here is my work:
-
The intended goal is to create a python development shell for the CAD application build123d.
-
System Information:
$ nixos-version
24.05pre608655.ff0dbd94265a (Uakari)
$ inxi -z
CPU: 8-Core AMD Ryzen 7 7730U with Radeon Graphics (-MT MCP-) speed/min/max: 2061/400/4546 MHz Kernel: 6.6.25 x86_64
Up: 13h 20m Mem: 22698.6/63719.8 MiB (35.6%) Storage: 1.82 TiB (83.1% used) Procs: 466 Shell: Bash inxi: 3.3.04
- Installation procedure:
Recommended
Development install
I have been trying the Recommended method, but would like to also setup a Development install.
# Recommended
>>> pip install build123d
or
# Development
>>> python3 -m pip install --upgrade pip
>>> git clone https://github.com/gumyr/build123d.git
>>> cd build123d
>>> python3 -m pip install -e .
-
I have attempted to follow the NixOS Wiki Python guide section Using nix-shell alongside pip
Following this example, I created a shell directory./build123d
and in it I created two files, per the wiki guide,shell-build123d.nix
andshell-python.nix
. -
The shell builds and enters successfully with
$ nix-shell shell-build123d.nix
. -
Following the install test from build123d install page:
>>> python
>>> from build123d import *
>>> print(Solid.make_box(1,2,3).show_topology(limit_class="Face"))
- The test should yield the results similar to:
Solid at 0x165e75379f0, Center(0.5, 1.0, 1.5)
└── Shell at 0x165eab056f0, Center(0.5, 1.0, 1.5)
├── Face at 0x165b35a3570, Center(0.0, 1.0, 1.5)
├── Face at 0x165e77957f0, Center(1.0, 1.0, 1.5)
├── Face at 0x165b3e730f0, Center(0.5, 0.0, 1.5)
├── Face at 0x165e8821570, Center(0.5, 2.0, 1.5)
├── Face at 0x165e88218f0, Center(0.5, 1.0, 0.0)
└── Face at 0x165eb21ee70, Center(0.5, 1.0, 3.0)
- The output from the configured shell does not match the expected result, it is instead:
$ python
Python 3.11.8 (main, Feb 6 2024, 21:21:21) [GCC 13.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from build123d import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/technicus/Projects/CAD/build123d/build123d_03/build123d/lib/python3.11/site-packages/build123d/__init__.py", line 3, in <module>
from build123d.build_common import *
File "/home/technicus/Projects/CAD/build123d/build123d_03/build123d/lib/python3.11/site-packages/build123d/build_common.py", line 57, in <module>
from build123d.geometry import Axis, Location, Plane, Vector, VectorLike
File "/home/technicus/Projects/CAD/build123d/build123d_03/build123d/lib/python3.11/site-packages/build123d/geometry.py", line 54, in <module>
from OCP.Bnd import Bnd_Box, Bnd_OBB
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
-
It is evidently having a problem linking
libstdc++.so.6
libraries. -
I have tried to follow What package provides libstdc++.so.6? and others like it, but have had no success, considering that I am having a little trouble following how to implement any of the solutions.
Thanks for reviewing my post.