How to recreate a necessary and minimal virtual env
-
wrote on 27 Jun 2023, 14:44 last edited by
Hi,
I have a PyQt6 application that was developed on a virtual environment. I try to dockerize this app but when trying to install the requirements with pip a dozen of the requirements fail with a message as this:ERROR: Could not find a version that satisfies the requirement libcomps==0.1.18 (from versions: 0.1.11.post1, 0.1.14.post1, 0.1.15.post1)
ERROR: No matching distribution found for libcomps==0.1.18
I created my requirements file with
pip freeze >requirement.txtI am thinking that there are a lot of superfluous packages installed.
Therefore I created a new virtual env and launched my application that complained about missing packages. I installed the claimed packages (whose list is dramatically shorter) and I could run my app but there are some dysfunctions. The most evident is a QTabWidget that displays 7 tab in the original virtual env and in the real env but displays only one tab in the new virtual env.Your help is welcome.
-
-
Hi,
I have a PyQt6 application that was developed on a virtual environment. I try to dockerize this app but when trying to install the requirements with pip a dozen of the requirements fail with a message as this:ERROR: Could not find a version that satisfies the requirement libcomps==0.1.18 (from versions: 0.1.11.post1, 0.1.14.post1, 0.1.15.post1)
ERROR: No matching distribution found for libcomps==0.1.18
I created my requirements file with
pip freeze >requirement.txtI am thinking that there are a lot of superfluous packages installed.
Therefore I created a new virtual env and launched my application that complained about missing packages. I installed the claimed packages (whose list is dramatically shorter) and I could run my app but there are some dysfunctions. The most evident is a QTabWidget that displays 7 tab in the original virtual env and in the real env but displays only one tab in the new virtual env.Your help is welcome.
Hi and welcome to devnet,
Does any of these tabs creation have something to do with the dependencies that are now absent ?
-
wrote on 28 Jun 2023, 03:56 last edited by jaaf
Hi, thank you for your welcome and for caring about my problem.
Since I posted my question I went a bit further.
Using the QtDesigner 6 I observed that the QTabWidget has a strange behavior.
Admit that it has 4 tabs. Tab1 ... Tab4.
When saving the form, if Tab4 is selected after converting it with pyuic6 when the app is running the QTabWidget appears with only Tab4 displayed. In this case there is no mean to make the others tabs show up.
But if Tab3 is selected when saving the form, Tab3 and Tab4 show up with Tab3 selected. In this case, selecting Tab4 makes the other Tabs appears. This is not satisfying as the user cannot see the other tabs at start up but it is much better than the previous situation.
Eventually, saving the form with Tab1 selected makes all the Tabs appear at start up, and this is good for the user of the app.
Do you think this is a normal behaviour or a bug to be reported ?
To answer your question it seems that this issue has nothing to do with the absent dependencies.
I also meet an other malfunctioning that I must investigate deeper.BTW I didn't receive a notification when you answered my post although I selected "Watchin" in the toolbar above ?
-
Can you provide a minimal script and
.ui
file that shows this issue ? It seems quite strange that setting a specific tab hides the others.As for the notifications, they should be on. You can check that in your account settings. If already checked, try to toggle the setting. I remember having to do that a long time ago.
-
wrote on 28 Jun 2023, 09:19 last edited by
Hi,
I tried to make a mini project with only a main window containing a QTabWidget with several tabs.
I also reproduced the virtual env that has no problem and the other that has problem.
I could not reproduce the malfunctioning. Both venv works properly. -
wrote on 29 Jun 2023, 04:29 last edited by jaaf
I could investigate a little further. I made some tests that show the the issue is inherent to the ui file not the rest of the application.
The issue can be reproduced in the designer itself (here QtDesigner 6).
If I select the last tab and save the file, then the preview shows only one tab and the others cannot show up.
i I select on intermediary tab and save the file, then the preview shows initially the last tabs but the others show up when I change the selection.
If I select the first tab, all is good.Give it a try yourself
link textYou can even reproduce this behaviour with fresh new mainwindow in which you add a QTabWidget with some tabs. Selecting one tab and looking at the preview.
-
I could investigate a little further. I made some tests that show the the issue is inherent to the ui file not the rest of the application.
The issue can be reproduced in the designer itself (here QtDesigner 6).
If I select the last tab and save the file, then the preview shows only one tab and the others cannot show up.
i I select on intermediary tab and save the file, then the preview shows initially the last tabs but the others show up when I change the selection.
If I select the first tab, all is good.Give it a try yourself
link textYou can even reproduce this behaviour with fresh new mainwindow in which you add a QTabWidget with some tabs. Selecting one tab and looking at the preview.
wrote on 29 Jun 2023, 08:06 last edited by JonBI could investigate a little further. I made some tests that show the the issue is inherent to the ui file not the rest of the application.
Before analyzing what you say any further: please make it 100% clear whether you only see this issue when previewing in Designer or whether it happens at runtime when you execute your program?
-
wrote on 29 Jun 2023, 10:55 last edited by
As I say in the first post of this thread, I first discovered the trouble at run time. Then after that I had this idea to check that with a simplified widget in the designer itself. It behaves the same i.e. as I describe in my last post.
What is more surprising is the fact that at run time with my original widget, the problem disappears when I deactivate my venv. But in Designer the behaviour remains the same whatever is the environment i.e. with the issue.. -
As I say in the first post of this thread, I first discovered the trouble at run time. Then after that I had this idea to check that with a simplified widget in the designer itself. It behaves the same i.e. as I describe in my last post.
What is more surprising is the fact that at run time with my original widget, the problem disappears when I deactivate my venv. But in Designer the behaviour remains the same whatever is the environment i.e. with the issue..wrote on 29 Jun 2023, 11:02 last edited by JonB@jaaf
And given that you are Python do you usepyqt6-uic
or whatever it is to produce a.py
source file from the.ui
file before running your code or do you useloadUi()
to read the.ui
file at runtime, since you could be doing either? -
wrote on 29 Jun 2023, 12:41 last edited by
I use pyuic6 command to transform the .ui to .py.
-
wrote on 29 Jun 2023, 14:42 last edited by
@jaaf
Then you can ignore the.ui
file. The only thing that runs is the.py
file. That will include whatever tab is selected initially from Designer. Check the code in that, play with it for different behaviour.My guess is whatever you are/are not seeing is to do with Qt6 rather than PyQt6.
If behaviour varies between virtual environments examine what could be different. Possibly a change in path/files picked up.
1/11