Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Python scripts do not work in the docker container cli.
Traceback (most recent call last):
File "", line 8, in
FileNotFoundError: [Errno 2] No such file or directory: '/lsiopy/bin/activate_this.py'
Expected Behavior
freecadcmd file.py
python function should run without the gui.
Steps To Reproduce
https://github.com/ThaL3g3nd27/issue-FreeCad-freecadcmd.git
LinuxServer/FreeCad – freecadcmd not working in cli
steps previous debugged ending with issue
All Code is available
- Add Dockerfile:
- Add the docker-compose.yaml
-
Build the Docker Image
docker-compose build
-
Run the image using docker-compose
docker-compose up -d
-
Open Browser to localhost:3000
App works great
-
Open the boxtest.py within the FreeCad Gui
File>Open>/app/py_scripts>boxtest.py (Defined in docker compose)
- Run the Code in the FreeCad Gui
- Box object is made
And auto exported/downloaded as a box.step file in /py_scripts
Python works Great!
(If Needed) shutdown container - docker compose down
ISSUE THE CLI doesn't WORK
- Delete the box.step file so we know if the python script was ran again.
- Docker Exec into the running container
docker exec -it freecad bash
- cd into the py_scripts directory
- Open the freecadcmd cli to make sure it works
This is due to Python environment variables…
Correct Example Usage:
https://youtu.be/RQW723n3DkU?si=dIt7jef6VmLHqkaF&t=596
Purpose of the issue:
The Purpose of doing it from the command line is to automate the creation of the object defined by parameters/database so a backend can parametrically make parts.
The gui will only be used for testing.
Link to linuxServer/FreeCad:
https://github.com/linuxserver/docker-freecad.git
Environment
- OS: Ubuntu on WSL
- How docker service was installed: docker compose build
# Use the LinuxServer.io FreeCAD Docker image
FROM lscr.io/linuxserver/freecad:latest
# Set the working directory
WORKDIR /app/
CPU architecture
x86-64
Docker creation
version: '3'
services:
freecad:
build:
context: .
container_name: freecad
security_opt:
- seccomp:unconfined #optional
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
volumes:
- ./config:/app/config
- ./py_scripts:/app/py_scripts
ports:
- "3000:3000"
- "3001:3001"
restart: unless-stopped
Container logs
root@a5613fcfb2a4:/app/py_scripts# freecadcmd boxtest.py
Traceback (most recent call last):
File "<string>", line 8, in <module>
FileNotFoundError: [Errno 2] No such file or directory: '/lsiopy/bin/activate_this.py'
FreeCAD 0.20.2, Libs: 0.20.2R
(c) Juergen Riegel, Werner Mayer, Yorik van Havre and others 2001-2022
FreeCAD is free and open-source software licensed under the terms of LGPL2+ license.
FreeCAD wouldn't be possible without FreeCAD community.
##### #### ### ####
# # # # # #
# ## #### #### # # # # #
#### # # # # # # # ##### # #
# # #### #### # # # # #
# # # # # # # # # ## ## ##
# # #### #### ### # # #### ## ## ##
Metadata
Assignees
Labels
Type
Projects
Status
Issues
Activity