Change reqd to make work with Ubuntu 22.04

Issue #596 new
cf created an issue

On a fairly fresh install of Ubuntu 22.04, I could not get FlatCam beta to work.

The problems seems to be around gdal and maybe vispy.

To get things working I did 4 things (one of which is probably not needed)… (I actually tried lots of things, but I think it boiled down to the 4 (or probably 3) things listed below.

  • I commented out the last line of setup_ubuntu.sh which is the easy_install line as in the research for trying to get the rest of it working, there was reference to this call not being needed now, and it seems to work without it.
  • I added libgdal-dev (sudo apt install libgdal-dev), perhaps this can be added to the setup_ubuntu.sh script, but I have no idea if there is a smaller better install which should be used instead. I did try a few things in this area, so hopefully it is just this one that got everything needed.
  • This step may not have been needed in the end… I uninstalled vispy (pip uninstall vispy) and installed 0.9.6 (sudo pip install vispy==0.9.6). Tried other versions from other issues, but they didn’t work, this one did… possibly after the following code change, this step might also have been not required (the default with ubuntu 22.04 of vispy 0.10.0 seems to also work).
  • I still had issues code in appGui/VisPyPatches.py so I edited this file as follows (I am not a python programmer).

In the apply_patches() function, I commented out the first patch to do with the cross function… error something to do with markers._marker_dict not being available. Searching the code base I could not find anything using a cross() function and everything seems to run OK (that I have tried)… Not being a python programmer, I have no idea if this is going to bite later down the track, but it got me working.

def apply_patches():
    # Patch MarkersVisual to have crossed lines marker
#    cross_lines = """
#    float cross(vec2 pointcoord, float size)
#    {
#        //vbar
#        float r1 = abs(pointcoord.x - 0.5)*size;
#        float r2 = abs(pointcoord.y - 0.5)*size - $v_size/2;
#        float vbar = max(r1,r2);
#        //hbar
#        float r3 = abs(pointcoord.y - 0.5)*size;
#        float r4 = abs(pointcoord.x - 0.5)*size - $v_size/2;
#        float hbar = max(r3,r4);
#        return min(vbar, hbar);
#    }
#    """
#
#    markers._marker_dict['++'] = cross_lines
#    markers.marker_types = tuple(sorted(list(markers._marker_dict.copy().keys())))

etc

I have marked the issue priority as major mainly because it stops you from using the tool on Ubuntu 22.04… if the above is all that is needed to fix, then maybe it is not such a major.

Finally, many thanks for creating such a tool!!! I know it takes lots of time and effort!

Comments (4)

  1. Danylo Ulianych

    Hi @cf,

    did you manage to install FlatCam on Ubuntu 22.04? python3-pyqt4 package is no longer available.

  2. cf reporter

    Yes, I have FlatCam working on Ubuntu 22.04, I don’t seem to have python3-pyqt4 installed.

    I seem to be running 8.994 Beta, other than the changes mentioned, I don’t recall doing anything else, though it was a while ago…

  3. Gabriel Bravo

    i cant to install Flatcam using recommended ways so i can to install it using Wine and the .exe files.
    Run ok but i still dont try to create gcode files because im still learning how to do it. But run ok.

  4. Alberto Trujillo-Rivera

    It works for me, as follows:

    User:~$ sudo apt install python3.10-venv
    User:~$ python3 -m venv tutorial-env
    User:~$ source tutorial-env/bin/activate
    (tutorial-env) User:~$ sudo chmod =x setup_ubuntu.sh
    (tutorial-env) User:~$ python -m pip install -r requirements.txt
    (tutorial-env) User:~$ python FlatCAM.py

    From the 8.994 Beta, and the following requirements.txt

    pyqt5==5.15.7
    numpy==1.21.3
    matplotlib==3.6.2
    cycler==0.11.0
    python-dateutil==2.8.2
    kiwisolver==1.4.4
    six==1.16.0
    setuptools==65.6.3
    dill==0.3.6
    rtree==1.0.1
    vispy==0.7.0
    ortools==9.5.2237
    svg.path==6.2
    simplejson==3.17.6
    shapely==1.8.4
    freetype-py==2.3.0
    fontTools==4.38.0
    rasterio==1.3.4
    lxml==4.9.2
    ezdxf==1.0.0
    qrcode==7.3.1
    reportlab==3.6.12
    svglib==1.4.1
    gdal==3.4.1
    pyserial==3.5

    best regards

  5. Log in to comment