make: *** No rule to make target 'qt5py3'. Stop - python

I'm working on a machine learning assignment. By the when I was trying to install the following file
brew install qt qt5
brew install libxml2
make qt5py3
python labelImg.py
python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]
at make qt5py3 the output from terminal is make: *** No rule to make target 'qt5py3'. Stop
I'm using OsX high sierra with default terminal
Does anyone know just what's happened?

To get the labelImg package (from the link you gave) working on OSX High Sierra, I needed to do the following.
First installed the missing lxml dependency using the solution in this answer
Also
brew install qt qt5
brew install libxml2
brew install pyqt5
After installing pyqt5, ensure that pyrcc5 can be run from the command line.
Download and unzip the labelImg .zip file from the link, and cd into the unzipped folder. Then
make qt5py3
When trying to run, I found it necessary to simplify the libs/usty.py file to remove the PyQt4 dependency. I just changed it to:
import sys
def ustr(x):
return x
At this point I can run the program with
python labelImg.py
Hope this is useful.

For me, I have occurred the same problem (MacOS version 10.13.4 and python 3.7) and solved using below steps.
Unzip the labelImg downloaded from here, cd labelImg-master
brew install qt qt5
brew install libxml2
brew install pyqt5
make qt5py3
python3 labelImg.py

you should download the project from github and enter the folder where file "makefile" is in,
then run make qt5py3

on Macbook
open terminal at folder "labelimg"
run:
make qt5py3

Came across this post (and maybe 30 others) while trying to install labelImg.
This gentleman's solution (from the beginning) finally allowed me to get started:
First, install Mini Conda (https://conda.io/docs/user-guide/install/macos.html), and open a new terminal window.
cd labelImg
conda create -n py2 python=2.7
source activate py2
conda install pyqt=4
conda install libxml2
conda install lxml
make qt4py2
python labelImg.py
https://gist.github.com/plopd/487f2caf2f983abc990987b97a8a734b

brew install qt qt5
downloaded and extracted zip file from
https://github.com/tzutalin/labelImg
make qt5py3
after running this command i got an error stating "No module found pyqt5";
pip install pyqt5
run
python labelImg.py

Related

Syntax Error from 'pip install' in python + command line

Okay, so, I'm running Python 3.4.3 with pip 9.0.1, with the setuptools and wheel.
I'm running this inside JetBrains PyCharm Professional 2017.2.3.
The issue I'm having is trying to install the twitter api packages from this tutorial (ya I'm a n00b) http://wiki.openhatch.org/Twitter
I'm struggling with installing the 4 dependencies mentioned in the first part of the tutorial (httplib2, simplejson, oauth2 and python-twitter)
Honestly, I'm just getting back into programming and this is a project I'd like to complete.
So, I need help with:
Installing pip, and how to use it, and where (python shell or command line or)
the dev.twitter.com website (and where to find what I need from there)
Any help is massively appreciated and sorry if I sound really n00by, but do correct me where I'm using incorrect terms etc because that's how I learn I guess :)
If you haven't got pip installed, find your python installation file.Execute it and choose 'Change Python Installation'. Now choose 'pip' to install and 'add python.exe to path'. Wait for it to finish. Now run windows command line and type:
pip install package_name
Sometimes you may experience that a package isn't available on pip or doesn't work.There are 2 common (not always working) ways to install a package without making pip download the file:
1) A package may be available as a .whl file for download.Download it.Now find it and copy its name .Open a command line in dictionary where it is located and type
pip install **now paste the filename and add .whl**'
2)A package is available as a zip file.Packages are often packed into a zip file.Download the file and extract it.Open a command line in it's directory.You may see setup.py file.Run
python setup.py install
When finished installing pip and adding python to path,you can run:
pip install httplib2 simplejson oauth2 python-twitter
Done.
Once you have pip installed, open the command prompt and just type pip install name_of_the_extension.
In this case, pip install httplib2 will install this package.
I believe you have pip installed on your computer, so it shouldn't be a problem to install the 4 packages you need.

How to properly install wxPython?

So I was looking around at different things to do on Python, like code for flashing text or a timer, but when I copied them into my window, there were constant syntax errors. Now, maybe you're not meant to copy them straight in, but one error I got was 'no module named wx'. I learned that I could get that module by installing wxPython. Problem is, I've tried all 4 options and none of them have worked for me. Which one do I download and how do I set it up using Windows?
Thanks
It's on PyPI. As of wxPython 4, Python 3 is supported.
Unfortunately, PyPI has a package called wx that is stuck at version 3.0.3; be sure to install the package named wxpython instead.
pip install wxpython
Please note that pip will automatically build wxWidgets for you, but it will not install wxWidgets system dependencies such as GTK and OpenGLu. If the above command exits with an error, look above for a message like this:
checking for <something>... not found
checking for <something>... no
configure: error: <prereq> libraries not available
Error running configure
ERROR: failed building widgets
This should give you information about at least one of the packages your system is missing.
The "official" list of prerequisites from the wxWidgets source is:
dpkg-dev
build-essential
libjpeg-dev
libtiff-dev
libsdl1.2-dev
libgstreamer-plugins-base0.10-dev # or 1.0 if available
libnotify-dev
freeglut3
freeglut3-dev
libsm-dev
libgtk-3-dev
libwebkitgtk-3.0-dev # or libwebkit2gtk-4.0-dev if available
libxtst-dev
The actual package names provided by your package manager may not match these exactly, and to be honest, I don't really know the best way to query a package manager to determine what packages provide the libraries you need.
3 steps to install wx-widgets and pygame in python IDLE
Install python 3xxx in your system opting (Add 3xxx to your path).
open python CLI to see whether python is working or not.
then open command prompt (CMD).
type PIP to see whether pip is installed or not.
enter command : pip install wheel
enter command : pip install pygame
To install wxpython
enter command : pip install -U wxPython
Thats all !!
As per home page instruction:
Make sure you have at least version 6.0.8 of pip and 12.0.5 for setuptools.
Install requirements for Linux as outlined in the readme.rst at:
https://github.com/wxWidgets/Phoenix/blob/master/README.rst
Install wxPython-Phoenix (Linux):
sudo pip install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
Install wxPython-Phoenix (Windows, use the appropriate script folder):
C:\python27\scripts\pip.exe install --upgrade --trusted-host wxpython.org --pre -f http://wxpython.org/Phoenix/snapshot-builds/ wxPython_Phoenix
I installed wxPython as part of the PsychoPy experiment builder dependencies, and had considerable trouble getting it to install properly as well initially. But this was what worked for me at the end. I use Ubuntu 16.04, python 3.5, pip3 19.0.3
pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython --user
If you use Conda then you may easily setup the environment with wx by one line:
$ conda create -n wxenv python=3 wxPython
Solving environment: done
## Package Plan ##
environment location: /home/user/.conda/envs/wxenv
added / updated specs:
- python=3
- wxpython
The following packages will be downloaded:
package | build
---------------------------|-----------------
[...]
Proceed ([y]/n)?
You need to ensure the versions of your wxPython download matches your installed python language library.
The current downloads wxPython downloads doesn't show any libraries built against python 3. I Believe the python 3 porting project is still ongoing.
If you are not sure of what you are doing I would stick with the 32bit version on windows as there are some Python libraries (ie IIRC, MySQLdb) which don't work with 64 bit python.
So you would then need to download python2.7 for windows x86 and "wxPython3.0-win32-py27 32-bit Python 2.7"
To install wxPython GUI library correctly go to the following page (https://wxpython.org/Phoenix/snapshot-builds/), which contains snapshots builds of wxPython library (Phoenix version) depending on your os and version of Python you want to work.
Then when you downloaded the proper package for your system and python version, simply install it by using pip. In my case I've choosen that one (wxPython_Phoenix-3.0.3.dev2811+ecc4797-cp36-cp36m-win_amd64.whl):
pip install wxPython_Phoenix-3.0.3.dev2811+ecc4797-cp36-cp36m-win_amd64.whl
To check that it has been installed sucessfully on the site-packages folder for your current python environment write:
pip freeze
It's all!
Check the version of wxpython and the version of python you have in your machine.
For python 2.7 use wxPython3.0-win32-3.0.2.0-py27 package
The problem was solved in openSuse simply with
zypper in python-wxWidgets-3_0-devel
Trying pip install before, gave me a lot of trouble (missing traits, missing wx/setup.h, https://github.com/wxWidgets/Phoenix/issues/1644, error: aggregate ‘wxGLAttributes _NullGLAttributes’ has incomplete type and cannot be defined, etc.).
wxpython failed to be installed with pipenv. Pipenv is not able to find wxpython binary so it tries to build wxpython but fails.
CXXFLAGS="-I/opt/homebrew/include" pipenv install wxpython
On my macOS M1 pipenv failed to install wxPython. After a lot of searching I found a forum post which really helped me fix the problem.
Source/Credits: https://forums.wxwidgets.org/viewtopic.php?t=47953&p=203709
Install current development version with:
pip install -U https://github.com/robotframework/RIDE/archive/master.zip
(python < 3.9) Install current Beta version (2.0b1) with:
pip install psutil
pip install -U --pre robotframework-ride
Note that I tried to install wxPython with 'pip install -U wxPython' as per instruction
with no avail. Too many errors to list here. 🤨
I found a solution to the problem!!
I'm working on a 64b machine and Windows 11 operating system using VSCode.
Here is the solution using PowerShell:
Version specs:
pip 22.3.1
virtualenv 20.15.1
python 3.10.8
Create a new virtual environment in the directory where the program resides and
activate. There must be no modules installed.
virtualenv venv
venv/scripts/activate.bat
Install the following in sequence:
pip install pygame
(Not sure why pygame must be installed first, but this was
recommended and it works) 😟
pip install -U wxPython
SUCCESS!!! 🤠
These are the modules installed:
numpy 1.24.1
Pillow 9.4.0
pip 22.3.1
pygame 2.1.2
setuptools 65.4.0
six 1.16.0
wheel 0.37.1
wxPython 4.2.0
VSCode still reports wx as a missing module even when you activate the virtual
environment within. Running the code from the PS command prompt within the virtual
environment is the only working solution.
PS. I am sure there are some conflicts when trying to install wxPython within an
environment where all the other modules are installed.

Error installing from GitHub using pip on Windows

I am on a Windows machine and I want to install a Python module from GitHub using pip directly from IPython.
The simplest command that seems it should work is:
!pip install https://github.com/japerk/nltk-trainer.git
I have also tried:
!pip install https://github.com/japerk/nltk-trainer.git#egg=nltk-trainer
I've used variants including -vvv, etc.
However, I'm getting the following error. Why?
Cannot determine archive format of C:\Users\timo\AppData\Local\Temp\pip-build-183bwemw\nltk-trainer
go to the https://github.com/japerk/nltk-trainer and download the project zip file. extract the zip file and put it somewhere in your computer.
open command prompt in windows and go inside the folder that you extracted earlier(you must be in the folder that has setup.py file in it).
enter the following command: python setup.py install
python tries to install nltk-trainer . during installation some other dependency might be installed too. you need numpy and scipy to be installed. if any problem happened during installation of numpy or scipy try installing them manually first by using pip install numpy and pip install scipy
if you can't install numpy and scipy using pip command use the following link:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
this site has compiled version of these libraries ( and other libraries if you need to install them too) you can download .whl file that is based on your python version and os architecture and install them using pip install filename.whl command ( you need to be in the folder that your whl file is) for example for python3.4 and 64bit operating system you may download scipy‑0.16.0‑cp34‑none‑win_amd64.whl file.

How to install pip in python 3.4 on windows?

I'm really struggling at installing any python modules (e.g six, yahoo_finance) because they require pip to be installed, but I don't know whether I have pip already or how to install it. Once its installed I don't know what command to type in and where to type it in. Can I install these modules any other way without pip?
I am only a beginner, so sorry if this is a bit basic.
Thanks in advance
pip comes already bundled with python 3.4 It will be in your scripts directory C:\Python34\Scripts\
Add it to your Environment variables and you can run it from any directory or else open the directory mentioned above in command prompt and run pip install ... to install whatever you want
First, make sure you have it installed, if not follow the instructions below. Type which pip, and if it doesn't list an URL, it means it's not installed yet.
Go here https://bootstrap.pypa.io/get-pip.py and download the file.
Then open terminal and go to your downloads folder (or wherever you downloaded it to) and type python get-pip.py to execute the script. If you get an error that says OSError: Permission Denied, or something similar, run it with administrator permissions.
If the installation is successful, you should now have pip installed on your computer. Type pip --version to make sure you have it installed.
To install six and yahoo_finance, type:
pip install six
and
pip install yahoo-finance
If something goes wrong update your question.
From Installing Python Modules:
pip is the preferred installer program. Starting with Python 3.4, it is included by default with the Python binary installers.
Emphasis mine
If you already installed it by default you should be able to use it.
Just open the command line and type python -m pip install SomePackage.

Installing Pyqt4 with brew

Im working with brew to install PyQt on python3 but I cant seem to get it to work
I ran brew install pyqt and brew doctor to fix all possible errors but still when running my code I keep getting
ImportError: No module named 'PyQt4'
If I run echo $PATH im getting /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
Can someone please guide me on fixing this problem? I am also using PyCharm but I still get the same error if I run in terminal python3 then import pyqt
please help me :( im really new in this but I tried everything that I could find in google
thanks!
PD: Running brew test pyqt does not bring an error but it does not open. Also I installed python3 with brew and im currently running it from /usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/bin/python3.4
If you want to use PyQt4 with Python 3, you should use this command to tell homebrew:
brew install PyQt --with-python3
I had the exact same problem. Installing using the instructions of Longhanks did not work as it said it was already installed.
I got it working with
brew reinstall PyQt --with-python3
The following method is for python 2.7. You can replace the 2.7 into your current python version like 3.4 (enter the directory to see which to use).
Because by default the python package is installed in /usr/local/lib/python2.7/site-packages which is not included in python library
try:
mkdir -p /Users/zgf/Library/Python/2.7/lib/python/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/zgf/Library/Python/2.7/lib/python/site-packages/homebrew.pth
where zgf should be replaced by your username in OSX.
You can also copy the relevant files from /usr/local/lib/python2.7/site-packages into your personal python site package directory or public site package directory (/Library/Python/2.7/site-packages) if you can root.

Categories

Resources