Can't access PyQt functions in PyCharm - pyqt

I've recently installed Pycharm and PyQt to start application development, but I can't seem to access the PyQt functions in my projects. The same code works if I open an example of PyQt, but if I paste it in my project, I get these squiggly underlines and an error upon compile.

The issue is with the pycharm skeleton file generator, encounters issues with some pyqt files, there is no pattern as to why this happens. I have had similar issue with pyqt 5.3 and the pycharm 3.4.1. I and several others spent hours on the issue, browsing the web for clues and trying everything suggested to no avail.
We eventually found a post on StackOverflow that indicated a solution. In our case applying it was quite simple: we did not observe this problem with pyqt 5.2 therefore we copied the skeleton files from that version into the 5.3 skeletons folder. The details of how to do this are available in a comment that I posted on the pycharm bug tracking site: PyCharm auto completion doesn't work for PyQt 5.3. The issue is discussed in other ticket I just found, which might provide an actual fix instead of just a temporary patch: Unresolved reference in PyQt for QtGui module.

Late , but after none of above methods not work I closed pycharm and restarted pyCharm by restarter.exe in this path:C:\Users\<user-name>\.PyCharm2016.2\system\restart , then reopened pycharm. In my case it just worked :)

Related

Is there a way to fix missing icon for Visual Studio Code on Wayland?

I have a problem with vscode if I run it on Wayland natively. Instead of appropriate icon I got a generic icon for Wayland applications as on screenshot.
I have tried to find a temporary solution editing .desktop files of vscode, but without success. As I know, the problem is in the wrong wmclass which sets on startup of vscode.
Upd:
I've got update from the AUR, which fixes all my issues)
I am struggling with this problem too.
I have tried to find solution and find a few issues
https://github.com/microsoft/vscode/issues/129953
Please check last messages at that discussion.
You can try to substitute value of WMClass with visual-studio-code of Code
StartupWMClass=code-url-handler
Also there is solution like this
"The problem can also be resolved by modifying the desktopName entry in /opt/visual-studio-code/resources/app/package.json to "desktopName": "visual-studio-code.desktop"" from that discussion too.

Visual Studio Code Python Refactoring not working in Version: 1.71.0 (and maybe not working for a while)

VSC's refactoring capabilities have been changing with Python for the last couple of years. I still have the option to refactor, but get the message "No refactorings available".
A year ago or more, installing Rope helped, but now, I get no refactoring options.
Docs say it is still available: https://code.visualstudio.com/docs/python/editing#_refactoring
What am I missing?
Simple things like extract function or rename.
VSC v1.71.1 against even the simplest .py script.
Tested in both Win10 and Mac Monterey.

Python 3.10 - ModuleNotFoundError: No module named 'win32.win32ui'

I just updated my python from 3.7 to 3.10 and now there are import error's.
While I just needed for import win32gui turn into import win32.win32gui as suggested here. There seems no other syntax for import win32ui, after some research I found this github report that has been closed with:
That's very helpful, thanks, and I can reproduce this in visual studio
I didn't consider that an exception was being caught and ignored. Turns out we aren't holding the GIL when we call back into Python -
I've no idea why this is different in 3.9 vs other versions, but the
fix is simple and is safe in all versions.
While there is suggested to comment out a line in a file named win32control which I apperantly dont have or find. Neither it seems possible in my compiled files that looks like:
G Áàȉ x#;÷щ
Nor do I understand the wheel solution and what to do with it, since I am still a beginner with hobby experience in python programming.
Update I just found this Q&A but not sure if it is related.
While it helped me on my other device to just reinstall my older python version, as stated in the comment section:
#CristiFati thanks for your reply. Since I installed my earlier
version of 3.7.2 again pywin works fine even if I run the code with
IDLE Shell 3.10.
This wasnt possible on my new device, but the Running as a Windows Service helped me out this time.
Manually copy pythonservice.exe from the site-packages/win32 directory
to the same place as these DLLs.

Visual Studio Code, pylint complaining about "Unable to import XXX"

I am using Visual Studio Code to work on a large python project with many modules.
My settings.json looks like this:
{
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.autoComplete.extraPaths": [
"C:/Users/.../repos/platform",
],
"python.linting.pylintPath": "pylint"
}
After that inside the code. I am getting a ton of error on all import modules which are inside the platform-folder.
I have python3 installed with python extensions and pylint installed as well.
I have searched for over an another and tried many different suggestions but none has worked for me so far.
The Current Problem you are facing is not regarding code formatting (by pylint).
you would rather want to choose the interpreter you want to have Intellisense for.
they are provided in docs as followed. link.
Hope this helps.
If it's TL;DR for you.
just press F1 on vscode window and type Python:Select you will get right prompts.
The answer above helped me out, thanks #srinath samala! Sharing why this worked for me in case it helps someone else.
I've been running Python on Windows 10 for a while, and months later installed Anaconda, which I don't think I did quite according to best practices. Windows machines can be annoying about proper PATH config etc...I probably need to uninstall and reinstall anaconda?
In any case, using the F1 key and Python:Select to point VS code toward which Python.exe file was being used made the difference here. Apparently using pip install in a windows bash session might make those packages available for one environment v the other? I'm sure this has something to do with my own (currently janky) directory structure, but VS code defaulted to Python's original home, and I got the import error. By selecting anaconda's version it found the package. Hope this helps someone else!

PyQt Release vs Debug

I have a system,written on PyQt4. It is mostly developed and debug under linux (ubuntu) systems, in Eric IDE, and everything works fine. Last task was to create a nested editor for a table cell. So, i did it and it also looks nice in ubuntu. I also ran it under Windows 7 x64, and the behavior was the same.
However, after making executable file with cx_Freeze in Windows 2000 (it's weird, but this environment was configured before me), the editors behavior became unexpected. After opening Editor it's first cell have 'role == Qt.EditRole', and it's almost impossible to commit any changes there without closing the whole Editor. Another issue is about "OK" button - it closes the Editor window, but doesn't commit any changes in it also, and you cannot call it again without changing the active cell (but maybe i just forgot to emit some signals here, so it's not the main bug here).
So my question - where should i look to find the reason for these problems. I'm new to qt, and maybe it is normal behavior and just my fault in code? Or the reason is in different environments (python 2.7, latest pyqt vs python 2.6 and some older pyqt). Or it is the influence of cx_Freeze... Maybe some other directions?
Sorry for long post and my English :)
Hope to get any answers soon.
I think there's a chance that Qt or PyQt on windows 2000 server is outdated or broken.
So If possible, bring cx_freeze related code to your local computer and test it out.
If it fixes the problem, you can upgrade or reinstall Qt on windows 2000 server.

Resources