View previous topic :: View next topic |
Author |
Message |
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Thu Dec 02, 2021 11:57 am Post subject: Flatcam on Gentoo |
|
|
I can only find one other post on this topic in the Forums (https://forums.gentoo.org/viewtopic-t-1096244-start-0.html), so I thought it might be helpful to post what I had to do to get Flatcam working on Gentoo as of December 2021.
The 8.994 beta uses Qt5, the source can be downloaded here: https://bitbucket.org/jpcgt/flatcam/downloads/FlatCAM_beta_8.994_sources.zip
All that follows was done as my user, using sudo for any emerge commands.
I went the route of cloning the beta repository, which I did as follows:
Code: | mkdir <suitable-folder>
cd <suitable-folder>
git clone --branch Beta https://<your-user-name>@bitbucket.org/jpcgt/flatcam.git |
This creates the directory flatcam, so
You will need the python pip utility for what follows, if you don't have it installed do this: Code: | sudo emerge dev-python/pip |
Now, do a trial run as follows:
This will throw up a "module not found" error.
You now have a choice of two routes:
1) Look for packages in Gentoo repositories that match the missing modules, install the ones you find, and use pip install --user for those you can't find. (This is what I did.)
2) Just use pip install --user for every module flagged as missing.
Whatever you choose, the above process is iterative, i.e Run flatcam, note missing module, find missing module and install it, repeat until Flatcam starts.
I don't think this is possible unless you have app-portage/eix installed. Code: | eix <missing-module-name> | works most of the time.
Specific point to note for the vispy package, you have to force install on version 0.7, not the latest version, thus: Code: | pip install --user vispy==0.7 |
https://bitbucket.org/jpcgt/flatcam/issues/538/ubuntu-fail-to-run-from-source (issue 538) explains the reason.
I managed to reduce the locally installed pip modules to the following: Code: | ipic@ian2 ~ $ pip list --user
Package Version
----------- --------
affine 2.3.0
cligj 0.7.2
ezdxf 0.17
freetype-py 2.2.0
ortools 9.1.9490
rasterio 1.2.10
snuggs 1.4.7
vispy 0.7.0
ipic@ian2 ~ $ |
The only special thing I did was to install dev-python/hsluv-python from the overlay src_prepare-overlay. This is because I already had that overlay enabled to get the Raspberry Pi imager (sys-boot/rpi-imager) installed.
Looking at the bitbucket repository, it seems that development is active, It also seems that the author is preparing a Qt6 release, which will of course blow all this out of the water.
Anyway, for the small audience that enjoys milling their own PCBs, I hope this was helpful.
EDIT: Spotted my user name in the bitbucket URL - replaced with a < > suggestion. |
|
Back to top |
|
|
turtles Veteran
Joined: 31 Dec 2004 Posts: 1694
|
Posted: Tue Dec 14, 2021 1:54 pm Post subject: |
|
|
Wow cool, i had no idea Flatcam existed.
http://flatcam.org/
I'll have to try it out.
Thanks for posting. _________________ Donate to Gentoo |
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Dec 24, 2021 7:09 pm Post subject: |
|
|
I stumbled upon the approach to setting up a virtual python environment, and gave it a go - and it works.
This opens up the possibility of trying the latest source (rather than the Beta), which I will give a go in due course.
Here is the approach I used to set up a virtual python environment, and install Flatcam Beta 8.994 into it (note that I have already installed all available python packages from the Gentoo repository as I found them, as described in the first post. Your install will go faster if you pip install anything Flatcam complains about being missing - this is most likely also a better approach in a virtual environment):
Code: |
mkdir flatcam-beta-vm
cd flatcam-beta-vm
python -m venv venv
source venv/bin/activate
# Prompt changes to: (venv) ....
git clone --branch Beta https://<your-username>@bitbucket.org/jpcgt/flatcam.git
pip install pip --upgrade
#NOTE: in the venv environment, " pip --user <package>" does not work, since everything is in this virtual environment.
pip install vispy==0.7
pip install affine
pip install cligj
pip install ezdxf
pip install freetype-py
pip install ortools
pip install rasterio
pip install snuggs
#To run:
python flatcam/FlatCAM.py
|
From now on, when doing things in flatcam-beta-vm remember to do this first:
Code: | cd flatcam-beta-vm
source venv/bin/activate |
|
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Jan 14, 2022 11:26 am Post subject: |
|
|
I've started using realthunder/FreeCAD_assembly3 as a more up to date version of Freecad, and uninstalled the Gentoo Freecad package since it was dragging some old versions of Python and opencascade with it.
Having done a emerge --depclean, of course Flatcam stopped working again. Using the post approach above, I found that this is the list of pip installs needed after removing Freecad:
Code: |
pip install vispy==0.7
pip install affine
pip install cligj
pip install ezdxf
pip install freetype-py
pip install ortools
pip install rasterio
pip install snuggs
pip install PyQt5
pip install simplejson
pip install shapely
pip install reportlab
pip install svglib
pip install pyopengl
pip install rtree
pip install matplotlib
pip install svg.path
pip install serial
pip install qrcode
pip install dill
|
Since I have other funky CAD and CAM software installed, this is still probably not a complete "clean install" list. |
|
Back to top |
|
|
dsiggi Tux's lil' helper
Joined: 28 Aug 2007 Posts: 92 Location: Wilhermsdorf
|
Posted: Fri Feb 11, 2022 8:13 am Post subject: |
|
|
Hi,
I'm also using FlatCAM do mill and drill pcb's.
For this reason I'm written some ebuilds for FlatCAM and it's deps.
You can find it here:
https://github.com/dsiggi/dsiggis-gentoo-overlay
Have fun with it.
dsiggi |
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Feb 11, 2022 10:12 am Post subject: |
|
|
That is awesome Thanks for the tip.
I see you have Candle and bCNC as well - looks like a great resource. |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Fri Jun 23, 2023 12:42 pm Post subject: |
|
|
Hate to bring up an old thread, but added you repo and then realized flatcam is not in it anymore. I'm having issues getting it to run function with using pip inside venv
Any current tips on this? Thanks!
EDIT: I also need bCNC that depends on svgelements, which isn't available. _________________ NooB since RedHat 6.1
Last edited by clytle374 on Fri Jun 23, 2023 1:02 pm; edited 1 time in total |
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Jun 23, 2023 1:01 pm Post subject: |
|
|
I think a change to python versions caused some issues with my original install, so I re-did it, and it works.
I used the following steps:
Code: |
# Run in a virtual python environment
mkdir flatcam-beta-vm
cd flatcam-beta-vm
python -m venv venv
source venv/bin/activate
# Prompt changes to: (venv) ....
git clone --branch Beta https://bitbucket.org/jpcgt/flatcam.git
pip install pip --upgrade
pip install vispy==0.7
pip install affine
pip install cligj
pip install ezdxf
pip install freetype-py
pip install ortools
pip install snuggs
pip install PyQt5
pip install simplejson
pip install shapely
pip install reportlab
pip install svglib
pip install pyopengl
pip install rtree
pip install matplotlib
pip install svg.path
pip install serial
pip install qrcode
pip install dill
pip install network
pip install rasterio
#To run:
python flatcam/FlatCAM.py
|
The rasterio issue from the original install appears to be fixed.
To start it I use the following bash script:
Code: |
#!/bin/sh
cd <path-from-above-install>/flatcam-beta-vm
source venv/bin/activate
python flatcam/FlatCAM.py
|
Hope this helps. |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Fri Jun 23, 2023 1:03 pm Post subject: |
|
|
replay about bCNC deleted, I did didn't realize who I was responding to. Thanks again _________________ NooB since RedHat 6.1 |
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Jun 23, 2023 1:07 pm Post subject: |
|
|
Quote: | Thanks, trying that now.
I also need bCNC that depends on svgelements, which isn't available. |
I have bCNC working with the following steps (change paths to suite your user..):
Code: |
# Run in a virtual python environment
In directory /home/ipic/Desktop/bCNC
mkdir bCNC-vm
cd bCNC-vm
python -m venv venv
source venv/bin/activate
# Prompt changes to: (venv) ....
pip install pip --upgrade
pip install bCNC
#To Run - in the above venv environment..
python -m bCNC
# Start file for general desktop use:
#!/bin/sh
cd /home/ipic/Desktop/bCNC/bCNC-vm
source venv/bin/activate
python -m bCNC
|
|
|
Back to top |
|
|
ipic Guru
Joined: 29 Dec 2003 Posts: 398 Location: UK
|
Posted: Fri Jun 23, 2023 1:09 pm Post subject: |
|
|
clytle374 wrote: | replay about bCNC deleted, I did didn't realize who I was responding to. Thanks again |
Is there a bCNC topic on the forum? |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Fri Jun 23, 2023 1:37 pm Post subject: |
|
|
ipic wrote: | clytle374 wrote: | replay about bCNC deleted, I did didn't realize who I was responding to. Thanks again |
Is there a bCNC topic on the forum? |
No, dsiggi mentioned their overlay and you responded that it also had bcnc in it. I thought you were dsiggi.
I'm getting the the same results this try also. If I use 3d rendering nothing displays when I load a gerber, if I use 2D it crashes when loading.
Code: | [DEBUG][MainThread] build_ui--> FlatCAMObj.build_ui()
Traceback (most recent call last):
File "/home/cory/sources/flatcam-beta-vm/flatcam/appTools/ToolPunchGerber.py", line 107, in on_object_combo_changed
grb_obj.mark_shapes.enabled = True
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cory/sources/flatcam-beta-vm/flatcam/appGUI/PlotCanvasLegacy.py", line 1596, in enabled
self.redraw()
File "/home/cory/sources/flatcam-beta-vm/flatcam/appGUI/PlotCanvasLegacy.py", line 1362, in redraw
self.axes.patches.clear()
^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ArtistList' object has no attribute 'clear'
Aborted
|
I guess I'll go to the flatcam group and see. I've tried a bunch of different output from Kicad (running from git source) and it makes no difference.
Thank you for the help!! Cory _________________ NooB since RedHat 6.1 |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Sun Jun 25, 2023 1:18 am Post subject: |
|
|
So here is what I had to do to get flatcam running. I don't know if it was older packages installed in the above posts, but I could not get the software to work.
I did as ipic stated in his very helpful posts, without which I'd never figured it out.
I used this fork instead
Code: | git clone https://bitbucket.org/marius_stanciu/flatcam_beta |
And this branch
Code: | git checkout Beta_8.995 |
Then to install requirements, I used this which pulls the requirements from the flatcam directory
Code: | pip install -r requirements.txt |
gdal tries to install V 7 and fails, so I used this
Code: | pip install gdal==3.6.4 |
Then I still needed these to get the program to run
Code: | pip install pyqtdarktheme==1.1.1 |
Code: | pip install darkdetect |
To get the gerber to display I had to goto Edit>Preferences> Graphic engine
check 3D
check 3D compatibility below that
Hope this helps someone. _________________ NooB since RedHat 6.1 |
|
Back to top |
|
|
steve_v Guru
Joined: 20 Jun 2004 Posts: 409 Location: New Zealand
|
Posted: Fri Jul 14, 2023 8:39 pm Post subject: |
|
|
Notes for anyone else fighting with this thing...
The 8.994 ebuild from dsiggis-gentoo-overlay is mostly fine, with a couple of minor changes:
Code: | --- ./FlatCAM-8.994.ebuild 2023-07-14 20:22:22.560628579 +1200
+++ FlatCAM-8.994-r1.ebuild 2023-07-15 08:25:02.458109034 +1200
@@ -32,3 +32,3 @@
$(python_gen_cond_dep 'dev-python/simplejson[${PYTHON_USEDEP}]')
- $(python_gen_cond_dep '>=dev-python/shapely-1.7[${PYTHON_USEDEP}]')
+ $(python_gen_cond_dep '<dev-python/shapely-2.0[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/freetype-py[${PYTHON_USEDEP}]')
@@ -47,2 +47,4 @@
$(python_gen_cond_dep 'dev-python/attrs[${PYTHON_USEDEP}]')
+ $(python_gen_cond_dep 'dev-python/hsluv[${PYTHON_USEDEP}]')
+ dev-lang/python[tk]
" |
That dep on shapely <2.0 is pretty annoying (and it took me a while to realise that's why the plot area remains blank, as clytle374 mentioned), but it is what it is. FlatCAM needs iteration over multi-part geometries, and that's gone as of 2.0.
The "Legacy (2D)" renderer still crashes, but OpenGL seems to work just fine here.
Now that I have it displaying something, on to the next issue: Trying to actually generate some code crashes with:
Code: | DEBUG] Starting G-Code...
[WARNING] Number of paths for which to generate GCode: 8
[DEBUG] Finished G-Code... 8 paths traced.
[DEBUG][Dummy-4] New object with name: Gerber_BottomLayer.GBL_iso_combined_cnc. 0.016415 seconds executing initialize().
[DEBUG] camlib.CNCJob.bounds()
[DEBUG][Dummy-4] Moving new object back to main thread.
[DEBUG][MainThread] on_object_created()
[DEBUG][MainThread] on_object_created --> OC.append()
WARNING: Traceback (most recent call last):
File "/opt/FlatCAM/appObjects/AppObject.py", line 356, in on_object_created
self.app.collection.append(obj)
File "/opt/FlatCAM/appObjects/ObjectCollection.py", line 572, in append
obj.set_ui(obj.ui_type(app=self.app))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/FlatCAM/appGUI/ObjectUI.py", line 2488, in __init__
self.jog_step_entry = FCSliderWithDoubleSpinner()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/FlatCAM/appGUI/GUIElements.py", line 1169, in __init__
self.slider.setMaximum(max)
File "/opt/FlatCAM/appGUI/GUIElements.py", line 1142, in setMaximum
return super(FCDoubleSlider, self).setMaximum(value * self._multi)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: setMaximum(self, a0: int): argument 1 has unexpected type 'float'
/usr/bin/FlatCAM: line 3: 5976 Aborted /usr/bin/python3 /opt/FlatCAM/FlatCAM.py |
Old deps, python 3.10 compat problems, "develoment paused", new not-released fork requires QT6 and has a bunch of other bugs. Sigh.
Thoughts? _________________ Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1898
|
Posted: Fri Jul 14, 2023 9:37 pm Post subject: |
|
|
steve_v wrote: | Code: | + dev-lang/python[tk] |
|
If you ever believe you need a dev-lang/python USE flag, then do not put it here.
Instead, it is PYTHON_REQ_USE="tk" before the inherit of a python eclass. |
|
Back to top |
|
|
steve_v Guru
Joined: 20 Jun 2004 Posts: 409 Location: New Zealand
|
Posted: Fri Jul 14, 2023 10:24 pm Post subject: |
|
|
grknight wrote: | If you ever believe you need a dev-lang/python USE flag, then do not put it here. |
Noted, but then at this point I'm pretty sure this whole endeavour is a fool's errand anyway. FlatCAM is a mess of random unreleased betas, forks, and outdated python dependencies, and it's full of bugs even when it doesn't crash.
Shame, it'd be a handy tool, but my patience for dependency-hell is limited.
Here's what I have, (mostly) working 8.994 QT5 fork if anyone wants to mess with it:
Code: | # Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10,11} )
PYTHON_REQ_USE="tk"
DISTUTILS_SINGLE_IMPL=1
inherit distutils-r1 desktop xdg-utils git-r3
DESCRIPTION="Generates CNC gcode from 2D PCB files (Gerber/Excellon/SVG)"
HOMEPAGE="http://flatcam.org"
EGIT_REPO_URI="https://bitbucket.org/marius_stanciu/flatcam_beta"
EGIT_BRANCH="Beta"
KEYWORDS="~amd64 ~x86 ~arm"
IUSE=""
LICENSE="GPLv2"
SLOT="0"
DEPEND="$(python_gen_cond_dep '>=dev-python/PyQt5-5.12.1[${PYTHON_USEDEP},printsupport]')
$(python_gen_cond_dep '>=dev-python/numpy-1.16[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/matplotlib-3.1[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/cycler-0.10[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/python-dateutil-2.1[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/kiwisolver-1.1[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/six[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/dill[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'sci-libs/rtree[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/pyopengl[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '=dev-python/vispy-0.9.0[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/or-tools-python[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/svg-path-4.0[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/simplejson[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '<dev-python/shapely-2.0[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/freetype-py[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/fonttools[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/rasterio[${PYTHON_SINGLE_USEDEP}]')
$(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/ezdxf-0.16.2[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/qrcode-6.1[${PYTHON_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/reportlab-3.5[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/svglib[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'sci-libs/gdal[${PYTHON_SINGLE_USEDEP}]')
$(python_gen_cond_dep '>=dev-python/pyserial-3.4[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/cssselect2[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/click[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/affine[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/attrs[${PYTHON_USEDEP}]')
$(python_gen_cond_dep 'dev-python/hsluv[${PYTHON_USEDEP}]')
"
src_compile() {
:
}
src_install() {
insinto /opt/${PN}
doins -r ${S}/*
exeinto /usr/bin/
doexe ${FILESDIR}/${PN}
doicon -s 128 "${FILESDIR}"/${PN}.png
make_desktop_entry /usr/bin/${PN} ${PN} /usr/share/icons/hicolor/128x128/apps/${PN}.png Electronics
}
pkg_postinst() {
xdg_desktop_database_update
xdg_icon_cache_update
}
pkg_postrm() {
xdg_desktop_database_update
xdg_icon_cache_update
}
|
_________________ Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy. |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Sun Aug 27, 2023 9:32 am Post subject: |
|
|
steve_v wrote: | grknight wrote: | If you ever believe you need a dev-lang/python USE flag, then do not put it here. |
Noted, but then at this point I'm pretty sure this whole endeavour is a fool's errand anyway. FlatCAM is a mess of random unreleased betas, forks, and outdated python dependencies, and it's full of bugs even when it doesn't crash.
Shame, it'd be a handy tool, but my patience for dependency-hell is limited.
|
I've been using the venv method with this fork
git clone https://bitbucket.org/marius_stanciu/flatcam_beta
branch
git checkout Beta_8.995
For about 2 months and haven't been having any crashes. I did have a few issues like climb and conventional cut being backwards, I filed a bug and they were fixed in a few hours. I think I had 3 total, and they were all fixed quickly.
Cory _________________ NooB since RedHat 6.1 |
|
Back to top |
|
|
clytle374 Apprentice
Joined: 01 Aug 2006 Posts: 221
|
Posted: Wed Jan 10, 2024 4:16 pm Post subject: |
|
|
clytle374 wrote: | So here is what I had to do to get flatcam running. I don't know if it was older packages installed in the above posts, but I could not get the software to work.
I did as ipic stated in his very helpful posts, without which I'd never figured it out.
I used this fork instead
Code: | git clone https://bitbucket.org/marius_stanciu/flatcam_beta |
And this branch
Code: | git checkout Beta_8.995 |
Then to install requirements, I used this which pulls the requirements from the flatcam directory
Code: | pip install -r requirements.txt |
gdal tries to install V 7 and fails, so I used this
Code: | pip install gdal==3.6.4 |
Then I still needed these to get the program to run
Code: | pip install pyqtdarktheme==1.1.1 |
Code: | pip install darkdetect |
To get the gerber to display I had to goto Edit>Preferences> Graphic engine
check 3D
check 3D compatibility below that
Hope this helps someone. |
As of Jan 1 2024 I had to use
Code: | pip install gdal==3.7.0 |
to get a matching version of libgdal
Darktheme didn't require a version and darkdetect wasn't needed. _________________ NooB since RedHat 6.1 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|