is there any PyQt modul which is available for python 2? - pyqt

i have a Toradex development board (Apalis iMX6q V1.1C
Ixora V1.1A
4.9.166 -2.8.6) and i want to use QT for application development for that i need PyQt..toradex has pip2 only and it is not having pip3 in its library..(for pip3 i have to do Custom image or to use Torizon,that i dont want) whenever i am trying to install PyQt from terminal it always showing requirement not satisfied whether it is PyQt4 or PyQt5..so i want to ask is there any PyQt module for python2 that i can install using pip2?

Related

No module named 'System'

I have an issue that has been discussed in some GitHub blogs but the answers there are so confusing and complex that I thought to ask here as well.
Before asking, let me just say I'm not an expert programmer, so my apologizes if mine is a simple question.
I recently had to install Python 3.7
I used to have modules like clr and System working totally fine and now everything seems broker.
I use Anaconda/Spyder to simply load the packages clr and System and Python gives me the following error messages:
No module named 'clr'
No module named 'System'
I managed to fix (apparently) the clr issue by running
pip install clr
from Anaconda Prompt.
However, in order to fix the issue with the System module, it seems I need to install pythonnet (I don't knoww exactly what it is but I guess it doesn't matter).
Based on anaconda official website: https://anaconda.org/pythonnet/pythonnet I should simply run:
conda install -c pythonnet pythonnet
But that doesn't work.
My extremely limited understanding is that something is going wrong between Pythonnet and Python 3.7.
Does anybody have a clue of what I should do?
you must uninstall first clr and then do pip install pythonnet. pythonnet has clr and System.
check documentation: https://github.com/pythonnet/pythonnet
you should use this:
import clr
clr.AddReference('System')
from System import String
What eventually worked for me, after messing around with my packages, was to: 1. uninstall clr. 2. Uninstall pythonnet. 3. Only at this point, I had to reinstall pythonnet. This sequence fixed my problem.
pip uninstall clr
pip uninstall pythonnet
pip install pythonnet
In my Python3, System is not a module - it's a method of the os module.
so I use
from os import system
then
system("<<Put Your Command Here>>")
If you want it called System with a capital S (maybe for backward compatability with already-written programs?), use
from os import system as System

Error While installing packages in pycharm i.e pandas and all

I have just installed pycharm 2019 edition. I have already installed python 3.7 in my system. My normal python program in pycharm is running fine i.e. printing hello world but I am not able to install packages like pandas and all. its showing error. 2nd thing i am not able to see latest version of pip that is been shown in pycharm.
I have tried to do this with some changes in manage repositories but It didn't wokred
While clicking on pip its showing "Error loading package list:pypi.python.org" this error message.
I want to install packages but cant able to do it.
Please download Anaconda Distribution, which is basically made for pandas and all. You can use Spyder which is one of the best tools for Data Science. There you can easily install pandas.

Downloading and installing PyBluez for a 64-bit Windows 10 PC?

I'm trying to use bluetooth with python, and I came across a module - pybluez. Right then, I tried installing it by running pip install pybluez. The package was located and downloaded, but it raised an error when running python setup.py egg_info.
I then tried to download pyBluez from this link https://pypi.python.org/pypi/PyBluez
But, it said that the Python version installed on my PC is not 2.7 ( I have 2.7.10; do I need 2.7.0 for this?) Also, this download link is for a 32-bit system, and that might be the reason it does not run on mine.
So I ask:
1. How do I fix this error?
Error in the output when I try to install pybluez using pip:
2.Does download using https://pypi.python.org/pypi/PyBluez need python 2.7.0, and a 32-bit system? If so, can someone suggest a better way for a 64-bit system?
3.Any other bluetooth module that could work as a substitute?
I have successfully built pybluez for win10x64 with python3.6
Download and install windows 10 build tools: https://www.visualstudio.com/pl/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15
Run 'Developer Command Prompt for VS' as administrator
Clone pybluez repo https://github.com/karulis/pybluez
cd to directory with repo
run python setup.py install
Happy bluetoothing
This is an "expanded solution" which supplements the other answers posted.
Bluetooth is readily supported on Linux in basically any context. Python 3 built-in socket objects work over bluetooth even. But for Windows, there are hoops to jump through. The standard solution for this is to use PyBluez. If you're really lucky, you might be able to install with just pip install PyBluez-win10. If that fails, however, the way to go is an installation via a pre-compiled "wheel".
A given wheel only works for your specific context, however, i.e. exact Python version. So, for the sake of future proofing, if you are going to need PyBluez, you should know how create a wheel from the source for yourself. It's a long, annoying process if you don't have the all the software required already and are not familiar with some parts of the process e.g. using Anaconda. So, if you are working in a team, I suggest having one person burn their time on this and then share the wheel with everyone (who are hopefully on the same version of Python!).
The following is a paraphrased version of what is posted here: https://github.com/pybluez/pybluez/issues/180 which includes the actual developer's comments and methodology.
Download and run the "Visual Studio Build Tools" installer:
For an official list of exact compilers and links to match against target Python versions, refer to: https://wiki.python.org/moin/WindowsCompilers
Here's the 2019 Build Tools link, which works with Py3.7:
https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019
During the install you MUST select BOTH "Visual C++ build tools" AND "Universal Windows Platform build tools". Leave the default options alone within those (e.g. including the Windows 10 SDK).
Note: this requires 15GB of disk space, and some patience!
Install "Miniconda":
https://docs.conda.io/en/latest/miniconda.html
Select the one which matches the bit set (32 vs 64) of the destination Python version
you wish to install PyBluez into.
Clone the PyBluez source repo to a temp location (e.g. your desktop). Then, launch the terminal and change into that directory:
git clone https://github.com/pybluez/pybluez
cd pybluez
If you did NOT put conda on the system path (as the installer recommends NOT doing so), you can add it for this local CMD session per this example command:
set CONDA_DIR=%USERPROFILE%\Miniconda3
set PATH=%CONDA_DIR%\condabin;%PATH%
Create a dedicated environment to build pybluez with the desired Python version. Then, launch that. The example below uses Python 3.7 but the same steps will also work for other versions (including Py 2.x etc)
conda create -y -n pybluez python==3.7
activate pybluez
Build a wheel file. Then, leave the dedicated environment.
python setup.py install
python setup.py bdist_wheel
deactivate
Copy the wheel to your desktop. From there, you can do with it as you wish. Then, delete the pybluez conda environment and the source repo, (as you no longer need either of them).
copy .\dist\*.whl "%USERPROFILE%\Desktop"
cd..
rd /s /q "%CONDA_DIR%\envs\pybluez"
rd /s /q pybluez
Finally, you can install the wheel to a target Python instance and/or store/share it:
The name of these files and the path will vary, so define those first for your use case
set PYBLUEZ_WHEEL=%USERPROFILE%\Desktop\PyBluez-0.22-cp37-cp37m-win_amd64.whl
set PYTHON_PATH=python
Install the wheel:
%PYTHON_PATH% -m pip install "%PYBLUEZ_WHEEL%"
Confirm installation:
%PYTHON_PATH% -c "import bluetooth; print(bluetooth.__version__)"
I downloaded a Python 3.6 wheel from here (wheels for python 2.7, 3.5, 3.6, 3.7 available too).
I installed it in my virtual environment via
pip install PyBluez-0.22-cp36-cp36m-win_amd64.whl
One command solution.
pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez

PyQt5: Cannot create cross-platform QtWebKitWidget application

I've developed a PyQt5 application on Linux (Ubuntu 16.04 LTS) that uses a QtWebKitWidget (QtWebView). It works great on Linux. I'm trying to package it for distribution for Windows using cx_Freeze, but the resulting application stops execution at launch with the PyQt5 error message "Import Error: Cannot import name 'QtWebKitWidgets.'"
I read that QtWebKitWidgets was deprecated from PyQt5 as of Qt 5.6, and that I should now use QtWebEngineWidgets instead. Fair enough. But I can't seem to install QtWebEngineWidgets on Ubuntu. I've installed Qt Creator 5.10 (most recent as of Dec 2017), and tried to include QtWebEngine via the oinline installation wizard, but the QtWebView widget is not listed in the toolbox.
My question: how can I use a PyQt5 WebView widget that will be cross-platform? If I use QtWebKit, it works on Linux but not on Windows. If I use QtWebEngine, it should work on Windows but not Linux.
What do I need to install on both platforms?
(Thanks in advance.)

Could not start Qt-designer

On windows7 64bits, I just installed Eric6 in this way :
python -m pip install pyqt5
python -m pip install QScintilla
install.py
I tried to follow their first tutorial LogParser on https://eric-ide.python-projects.org/tutorials/LogParser/chap2.html
When coming to create LogParser.ui I get the following error :
Could not start Qt-designer
Ensure that it is available as ...Python36\lib\site-packages\PyQt5\Qt\bin\designer.exe
When checking there is a folder: C:\Users\Gustav\AppData\Local\Programs\Python\Python36\Lib\site-packages\PyQt5\Qt\bin
But its not containg any exe file
Any help would be nice !
I managed to install QT Designer as follows (as a stand-alone application, not using Eric IDE):
Install latest QT (I'm using 5.8) from QT main site
Make sure you include "Qt 5.8 MinGW" component
QT Designer will be installed in C:\Qt\5.8\mingw53_32\bin\designer.exe
Note that the executable is named "designer.exe"

Resources