Hi all, I want to install "FreeCAD" package for one of my app

Can someone help? it is not possible through usual way of mentioning in the requirement.txt file. On my local app, I installed freecad and then gave the path to bin in the code. However, dont know how to give the path in the cloud. Tried pathlib way of doing it, not working.

Hi @Sandeep_Kumar

I checked out the freecad package’s website and looked for how to install on a Linux OS and was brought to the following page:

https://wiki.freecad.org/Installing_on_Linux

On there, freecad can be installed on Debian OS distribution (e.g. Ubuntu) which is therefore supported on the Streamlit Community Cloud.

Packages specified in requirements.txt are for those that you would normally install via pip install <package-name> whereas to install via the linux command line the above page lists the following:

sudo apt-get install freecad

Thus, you can specify the package name freecad in the packages.txt file:

freecad

Hope this helps!

Hello,

Thank you for the solution. I added freecad to the packages.txt, but it is throwing error when I try to import the package in the .py file:

ModuleNotFoundError: This app has encountered an error. The original error message is redacted to prevent data leaks. Full error details have been recorded in the logs (if you’re on Streamlit Cloud, click on ‘Manage app’ in the lower right of your app).

Traceback:

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)File "/app/intell3d_app_11_7_23/3d_printing_gui.py", line 30, in <module>
    import FreeCAD

#--------------------------------------------------------
this is the starting part of my code:

#----------------- Final version of the GUI code-----------------------
#----------------- Final version of the GUI code-----------------------
import sys
import streamlit as st
from io import StringIO
from PIL import Image
import tkinter as tk
from tkinter import filedialog
import os
import PyPDF2
import pandas as pd
from pdf2image import convert_from_path
import cv2
import pytesseract
from PIL import Image
import numpy as np
from stl import mesh
import math
import stl
from statistics import variance
import pickle

di = os.getcwd()

import pathlib
from pathlib import Path
p=pathlib.Path().resolve()
FREECADPATH = str(p)+“\reference\FreeCAD 0.20\bin”
sys.path.append(FREECADPATH)
import FreeCAD
import Part
import Mesh

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.