- edited description
saving projet with only one excellon file
Open Flatcam (ver. 2021/2/7).
Import one excellon file (2-5 inch T)
Try to save project.
Get:
[DEBUG][Dummy-4] save_project() -> Saving Project
[ERROR][Dummy-4] Abnormal termination of process!
[ERROR][Dummy-4] <class 'TypeError'>
[ERROR][Dummy-4] AppLogging.error() takes 2 positional arguments but 3 were given
[ERROR][Dummy-4] <traceback object at 0x7f8ad2af1680>
Traceback (most recent call last):
File "/opt/flatcam-qt6/app_Main.py", line 11832, in save_project
project_as_json = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8')
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/__init__.py", line 412, in dumps
**kw).encode(obj)
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 298, in encode
chunks = list(chunks)
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 704, in _iterencode
for chunk in _iterencode_dict(o, _current_indent_level):
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict
for chunk in chunks:
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 534, in _iterencode_list
for chunk in chunks:
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict
for chunk in chunks:
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict
for chunk in chunks:
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict
for chunk in chunks:
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 725, in _iterencode
for chunk in _iterencode(o, _current_indent_level):
File "/home/kika/.local/lib/python3.10/site-packages/simplejson/encoder.py", line 722, in _iterencode
raise ValueError("Circular reference detected")
ValueError: Circular reference detected
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/flatcam-qt6/appWorker.py", line 61, in do_worker_task
task['fcn'](*task['params'])
File "/opt/flatcam-qt6/app_Main.py", line 11842, in save_project
self.log.error("Failed to save file: %s", str(filename))
TypeError: AppLogging.error() takes 2 positional arguments but 3 were given
FlatPrj file not created.
Comments (24)
-
reporter -
reporter - edited description
-
Hello,
Probable there are some other errors that triggered the one in thelog
subclass that I made. But essentially, the FlatCAM beta version available on this repo is not ready for Python 3.10. Use Python 3.9.
Otherwise, if you want to try my working copy which use Python 3.10 and PyQt6, use theBeta_8.995
branch on my personal Bitbucket repo, here: https://bitbucket.org/marius_stanciu/flatcam_beta/get/Beta_8.995.zip
But check the Issues section first (on my repo) to see what is not working currently. -
reporter I’ve using python10 + qt6 version, isn’t it? Described issue concerning flatcam-qt6, installed by AUR flatcam-qt6 package… It takes source from https://bitbucket.org/marius_stanciu/flatcam_beta.git
-
Hi,
True, I was stuck in the date mentioned 7 Feb 2021. And it made no sense for me, why someone was using such an old commit so I just jumped to conclusion.
As for the AUR package, I have no idea what your are talking about. Perhaps you can tell me what is all about?
-
reporter Oh, About AUR: I am an Arch Linux user and have install flatcam-qt6 by system package manager (https://aur.archlinux.org/packages/flatcam-qt6/) which takes source from https://bitbucket.org/marius_stanciu/flatcam_beta.git. So i already have a QT6 version?
“2021/2/7” is a date from 'About' window in Flatcam, i wrote this only to specify version I have.
-
I know that I am not working as I am supposed to but all my fixes go in the same branch (currently
Beta_8.995
) and once I have a version I'm happy with (most of the bugs solved) I then merge it in theBeta
branch. But theBeta
branch is still based on PyQt5 and since you say you are using the PyQt6 version it looks like you are using the Unstable version. But what commit are you using? The date in theAbout
page is not relevant since it is just a date in future (now in the past) that I added at some point in time in the hope that at that moment I will make an release. Which obviously it did not happen since the content was not pushed to theBeta
branch which is theMain
branch for me.So, what matter is: are you using the latest commit from my Bitbucket repository? If not, what commit are you using?
-
And using the latest commit I get what is expected (except that I did not configured the format but that does not matter for the saving):
-
reporter It seems to be 'Beta_8.995' branch.
r4043.f3d379e4-1
-
Hi Cyrill,
Can you try those sources? They are the latest. I looked on the source and the reported line in your error is at a totally other line in my sources so we talk about different commits.
https://bitbucket.org/marius_stanciu/flatcam_beta/get/Beta_8.995.zip
The error you mention was fixed a long long time ago so…. Are you saving with the default setting (compressed)?Using the above sources you get the same error?
-
reporter Yes, I saving with complession, level 3.
Btw, if I delete excellon from project I can normally save it. Then add it again – can’t save again (same trace, same files&lines). And so on.Will try new sources tomorrow.
-
reporter Now i’m trying
r4080.af688cb3-1
from Beta. Where should I post issues about this branch?Now I have this:
[DEBUG][MainThread] Finished Canvas initialization in 0.2633070945739746 seconds. [DEBUG][MainThread] Finished creating Workers crew. [DEBUG][MainThread] TCL Shell has been initialized. [DEBUG][MainThread] App.__init__() install_tools() --> 'NoneType' object has no attribute 'view' [DEBUG][MainThread] app_Main.__init__() --> Geo Editor Error: 'NoneType' object has no attribute 'new_shape_collection' [DEBUG][MainThread] app_Main.__init__() --> Excellon Editor Error: 'NoneType' object has no attribute 'new_shape_collection' [DEBUG][MainThread] app_Main.__init__() --> Gerber Editor Error: 'NoneType' object has no attribute 'new_shape_collection' [DEBUG][MainThread] Initialization of the GCode Editor is finished ... [DEBUG][MainThread] Finished adding FlatCAM Editor's. [DEBUG][MainThread] + Adding Exclusion Areas [DEBUG][MainThread] Recent items list has been populated. Traceback (most recent call last): File "/opt/flatcam-qt6/FlatCAM.py", line 93, in <module> fc = App(qapp=app) File "/opt/flatcam-qt6/app_Main.py", line 1479, in __init__ self.ui.menuview_toggle_grid_lines.triggered.connect(self.plotcanvas.on_toggle_grid_lines) # kika AttributeError: 'NoneType' object has no attribute 'on_toggle_grid_lines'
-
Hi,
It is obviously that you do something wrong since those errors never occur for me. Without knowing the steps you are doing there is little no none help that I can give.
The latest commit on my repo is 4089438. The coder4080.af688cb3-1
tells me nothing.
-
And to make my case I just downloaded the ZIP file as mentioned above and run the sources. The result can be seen here:
-
reporter Yes, thanks. I am apologize for the fact that I confused and did not understand all repos branches, qt and python versions.
-
reporter - changed status to open
It is about marius_stanciu /Beta_8.995 commit 40894383 At my setup saving project with this file still not working.
[DEBUG][MainThread] excellon [DEBUG][MainThread] /home/kika/docs/eagle-local/projects-local/1533gen-flatcam/1533gen.drd [DEBUG][Dummy-4] 0.124172 seconds adding object and plotting. [DEBUG][MainThread] build_ui--> FlatCAMObj.build_ui() [DEBUG][Dummy-5] save_project() -> Saving Project [ERROR][Dummy-5] Abnormal termination of process! [ERROR][Dummy-5] <class 'TypeError'> [ERROR][Dummy-5] error() takes 2 positional arguments but 3 were given [ERROR][Dummy-5] <traceback object at 0x7f1f5529a480> Traceback (most recent call last): File "/home/kika/build/flatcam-qt6/flatcam_beta/app_Main.py", line 11918, in save_project project_as_json = json.dumps(d, default=to_dict, indent=2, sort_keys=True).encode('utf-8') File "/home/kika/.local/lib/python3.9/site-packages/simplejson/__init__.py", line 398, in dumps return cls( File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 298, in encode chunks = list(chunks) File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 704, in _iterencode for chunk in _iterencode_dict(o, _current_indent_level): File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict for chunk in chunks: File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 534, in _iterencode_list for chunk in chunks: File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict for chunk in chunks: File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict for chunk in chunks: File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 658, in _iterencode_dict for chunk in chunks: File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 725, in _iterencode for chunk in _iterencode(o, _current_indent_level): File "/home/kika/.local/lib/python3.9/site-packages/simplejson/encoder.py", line 722, in _iterencode raise ValueError("Circular reference detected") ValueError: Circular reference detected During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/kika/build/flatcam-qt6/flatcam_beta/appWorker.py", line 61, in do_worker_task task['fcn'](*task['params']) File "/home/kika/build/flatcam-qt6/flatcam_beta/app_Main.py", line 11928, in save_project self.log.error("Failed to save file: %s", str(filename)) TypeError: error() takes 2 positional arguments but 3 were given
$ git checkout Your branch is up to date with 'origin/Beta_8.995'. $ git rev-parse --short HEAD 40894383
At the screenshoot there is previously saved project it does not matter.
-
Hi,
The last error is not such a big deal it is just a syntax error in a log.error. The real error that trigger this error is the ‘circular reference detected’ and that one is a nasty one.
I have made a few changes (you could try to update to the latest commit) but bottom line is that this issue is related to your setup. I can’t see this error in Windows and many other people are using Linux and MacOS and none had reported this error.
What I would do in your case is to create a virtual environment, try to install all the packages in therequirements.txt
and/orsetup_ubuntu.sh
files and run FlatCAM beta from there. I don’t know much about Linux, at least not enough to go deeper on why this is working for almost everybody and why not in your case.So, try the latest commit maybe this will do something for the better, I have added a second layer of copy() for the objects.
-
And just to see if there is an issue with Linux, I just run a virtual machine with an Ubuntu 20.04 got from https://www.linuxvmimages.com/images/ubuntu-2004/.
I cloned my repo, switched to the Beta_8.995 branch.
I installed thevirtualenv
Pyhon package, created a virtual environment, installed all the packages from therequirements.txt
file.
After running FlatCAM Evo Unstable beta, I loaded your Excellon file and then saved the project. All worked as expected, no errors.
After that I loaded the saved project and all loaded Ok.
-
Ok, just wasted some more time.
I found an VmWare image of Arch Linux on https://www.linuxvmimages.com/images/archlinux-2021.
I downloaded it and run it just to see that it was a simple command line… Updated the installation, installedxorg
, installedGnome
, created a Python virtual environment. Some packages had to be installed withpacman,
some withpip
. In the end it something was messy when using FlatCAM with the3D engine
(some errors regarding theglut
although I installed theglut
package withpacman
and there was no rendering on the canvas for the shapes that had filling). I run FlatCAM Evo beta with the2D engine
and that worked.In any case, loading your Excellon file in both graphic modes, I was able to save just fine.
There were no errors when saving the project which leads me to believe that you have some issues with your Linux.
-
reporter Thanks a lot. Can we compare please versions of all dependency modules?
-
Hi,
Unfortunately I’m running low on space on the notebook HDD so after I finished that blundering install (trying this and that) and saw that the issue is not there, I deleted everything.
All I remember from that half-a-sleep install was that at first I did not used the the virtual environment and I started to install everything on the main system Python (I think it was Python 3.10.2) with the pip package (I had to install that one too, that Linux Arch was really a barebone install). One thing came to mind is thesimplejson
package that I installed in both the main Python and after that in the virtual environment.
All the packages had to be installed, at least in the virtual environment, Some extra needed was thesudo pacman -S spatialindex
,sudo pacman -S python-rtree
and others.
Try to find if you can install the packages first with pacman (likesudo pacman -S python-pyqt6
) and have them installed also with pip in the virtual environment (with saypip install pyqt6
).
I know, it was a mess, but my goal was to see if there is a saving issue not to create a guide to install FlatCAM Evo (beta) in Arch Linux because I have absolutely no experience with Arch Linux except my blundering install from last night. -
BTW, you can download yourself one of those virtual machines, perhaps the VirtualBox one and see what you can do inside without damaging your main OS.
https://www.linuxvmimages.com/images/archlinux-2021LLE: and if you find that installing
GDAL
andRasterio
is too bothersome (it’s not a simplepip install etc
) you could not install them, the app will still work, although theImage Import plugin
will no longer be available. -
reporter Thanks.
At the fresh setup all is working fine (python3.10).
Installed through YAY from AUR with PKGBULD file updated this month (‘flatcam-qt6’ package which takes src from 'https://bitbucket.org/marius_stanciu/flatcam_beta/commits/branch/Beta_8.995').
In this case most of all dependencies have installed system-wide by package manager including ‘rasterio’ and ‘gdal’. Also some additional deps have installed for user with ‘pip -r requirements.txt’.
-
reporter - changed status to resolved
At the fresh setup all is working fine (python3.10).
- Log in to comment