A program I am trying to install requires the installation of PyQt5 5.15.0 , which gives me this error. The odd thing is that the installation works fine for the latest version of PyQt5 (5.15.2), but this program requires 5.15.0 specifically.
Command Output:
Collecting PyQt5==5.15.0
Using cached PyQt5-5.15.0.tar.gz (3.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\mshal\appdata\local\programs\python\python39\python.exe' 'C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\mshal\AppData\Local\Temp\tmp41s11ev6'
cwd: C:\Users\mshal\AppData\Local\Temp\pip-install-sfw90hvc\pyqt5_e2cc46859b554da7b84798abae5378ba
Complete output (31 lines):
Traceback (most recent call last):
File "C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py", line 126, in prepare_metadata_for_build_wheel
hook = backend.prepare_metadata_for_build_wheel
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py", line 280, in <module>
main()
File "C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py", line 263, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py", line 130, in prepare_metadata_for_build_wheel
return _get_wheel_metadata_from_wheel(backend, metadata_directory,
File "C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py", line 159, in _get_wheel_metadata_from_wheel
whl_basename = backend.build_wheel(metadata_directory, config_settings)
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\sipbuild\api.py", line 51, in build_wheel
project = AbstractProject.bootstrap('pep517')
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\sipbuild\abstract_project.py", line 83, in bootstrap
project.setup(pyproject, tool, tool_description)
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\sipbuild\project.py", line 479, in setup
self.apply_user_defaults(tool)
File "project.py", line 62, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\pyqtbuild\project.py", line 79, in apply_user_defaults
super().apply_user_defaults(tool)
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\sipbuild\project.py", line 225, in apply_user_defaults
self.builder.apply_user_defaults(tool)
File "C:\Users\mshal\AppData\Local\Temp\pip-build-env-nnx_yu09\overlay\Lib\site-packages\pyqtbuild\builder.py", line 66, in apply_user_defaults
raise PyProjectOptionException('qmake',
sipbuild.pyproject.PyProjectOptionException
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\mshal\appdata\local\programs\python\python39\python.exe' 'C:\Users\mshal\AppData\Roaming\Python\Python39\site-packages\pip\_vendor\pep517\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\mshal\AppData\Local\Temp\tmp41s11ev6' Check the logs for full command output.
I am on the latest version of pip. Any ideas on the root cause of this issue?
What helped me is upgrading pip from 20.2.3 to the latest one (in my case 21.1.1)
For Mac/Homebrew users.
The answer by #the-x is leading in the right direction. On a Mac with QT5 installed via Homebrew the qmake binary just needs to be added to the path. This can be achieved through
export PATH="/opt/homebrew/opt/qt5/bin:$PATH"
(of course depending on where the homebrew files are installed)
Running on arm with python3.6 (ubuntu18 on nvidia Xavier):
sudo apt install qt5-default
For MacOS users.
I am on Apple M1 silicon using Python 3.9.8. What worked for me was #Apaul's comment in the original question section. Install pyqt5-sip prior to pyqt5.
I also have an Intel Mac and on that machine, I do not need to do this.
Checking the binaries that PyQt5 provides in pypi for version 5.15.0 I see that it does not provide the binaries for python3.9 in windows, so pip is trying to compile using the source code which is complicated and can generate several dependency problems (for example you must have Qt 5.15 installed, etc). So my recommendation is to install a more updated version of PyQt5, for example 5.15.2 since if it provides the binaries for python3.9 on windows, in addition to being a wrapper of an LTS version of Qt then it will have solved several bugs.
python -m pip install PyQt5==5.15.2
Another solution is to use python3.8 instead of python3.9 so that you can install pyqt5 5.15.0 from pypi without problems.
Upgrading your pip enables you to install PyQt5. Personally, I had the same issue while installing PyQt6 and I upgraded my pip, and everything installed perfectly. I think both python and pip versions play an important role in installing PyQt so make sure you have later versions.
This is the command I used in Linux:
pip install --upgrade pip
Combining several answers on this question: On an Apple M1 Pro Macbook with macOS Ventura 13.0.1, with Homebrew 3.6.17 and python 3.11.0 the following commands fixed it for me (no sudo):
brew install qt5
export PATH="/opt/homebrew/opt/qt5/bin:$PATH"
python3 -m ensurepip --default-pip
pip3 install pyqt5-sip
pip3 install pyqt5 --config-settings --confirm-license= --verbose
That last step calls qmake to compile all of Qt on your M1 and takes many minutes to complete, be patient and let it finish.
Since qt5-default was not available, I installed qt5-default's dependencies
sudo apt-get install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
after that I installed pyqt5 via apt-get first and afterwards via pip
sudo apt-get install pyqt5-dev
pip install pyqt5
now wheel seems to work
side-note:
I am not sure if sudo apt-get install pyqt5-dev is even necessary
The error message thrown here is misleading - it's not an issue with a sipbuild.api attribute. Indeed, in this case program qmake is missing, see last line of the Python traceback. Have a look if it's installed on your system and add it to your PATH variable. Otherwise, install it. On Linux this would be done with
sudo apt-get install qt5-qmake
I had this problem on my M1 Mac using Python 3.9.12 when I was trying to install a library: pip install pixellib.
The first thing I did was: pip install pixellib --verbose to see the whole log, and there I noticed that PyQt5 was waiting for an input. So then I found someone else with that issue, and used pip install pyqt5 --config-settings --confirm-license= --verbose which took some time to compile, but worked!
I could not get any of the above solutions to work but I managed to get it working using python3.9, PyQt5=5.15.2, pip=22.0.2 and sip=6.5.0 by using sudo apt-get install PyQt5. If you need it in a virtual environment, you can manually copy the PyQt5 folder from your default /usr/lib/python3/dist-packages to the site-packages folder in your virtual environment.
To all those that are struggling with Apple M1 installation, here is a working solution, specifically addressing the problem of installing the pixellib library that depends on PyQt5 but you can apply it equally to other libs:
PyQt5 is not supported on Apple M1, it needs qt6: https://www.reddit.com/r/learnpython/comments/o4w1ut/comment/h2jele3/?utm_source=share&utm_medium=web2x&context=3 , https://www.qt.io/product/qt6
this means you need to install PyQt6: python3 -m pip install PyQt6
go to the lib you need, in my case pixellib: https://pypi.org/project/pixellib/#files and
download the wheel file
get the wheel tool: pip install wheel
unpack the wheel wheel unpack pixellib-0.7.1-py3-none-any.whl
Change its dependency of PyQt5 to PyQt6
edit pixellib-0.7.1/pixellib-0.7.1.dist-info/METADATA
pyQt5 => pyQt6
pack it back wheel pack pixellib-0.7.1
install it: pip install pixellib-0.7.1-py3-none-any.whl
test in python: `
# should work
import pixellib
P.S. thanks to Terra and ChaOS for supporting work on the project underlying this report.
I finally managed to make it works on M1/M2 Macbook Pro.
None of these answers worked for me, so I looked at brew to install pyqt.
The following command will install pyqt5 via brew:
brew install pyqt#5
Then it just worked.
This can be resolved by switching to an environment with Python >= 3.8
I'm trying to install yq#3 on my Mac running brew install yq#3 and I get the error:
Error: yq#3 has been disabled because it is not maintained upstream!
I see that it's there on their website at https://formulae.brew.sh/formula/yq#3#default but it doesn't seem to be supported anymore.
I still need to install it since our projects at work are using this specific version.
The only way that I'm thinking about is downloading the source code, building it myself, and adding it to the path but I'm thinking that there might be a simpler solution.
Any suggestion?
Thanks!
From yq github, you can install a binary by running:
wget https://github.com/mikefarah/yq/releases/download/3.4.1/yq_darwin_amd64 -O /usr/local/bin/yq &&\
chmod +x /usr/local/bin/yq
3.4.1 is the latest 3 version, darwin_amd64 is the Mac package (don't worry about having an Intel machine and installing the package that says AMD, the name comes from something about AMD invented the 64-bit instruction set).
Trying to use the perf profiler. I've installed linux generic tools, but no luck. Here is the message I'm getting:
r#r-K55A:~$ perf
WARNING: perf not found for kernel 3.16.0-45
You may need to install the following packages for this specific kernel:
linux-tools-3.16.0-45-generic
linux-cloud-tools-3.16.0-45-generic
You may also want to install one of the following packages to keep up to date:
linux-tools-generic
linux-cloud-tools-generic
I've tried to install the above packages, but I get the following error:
Unable to locate package linux-tools-3.16.0-45-generic
E: Couldn't find any package by regex 'linux-tools-3.16.0-45-generic'
You can safely use this snippet:
sudo apt install linux-tools-common linux-tools-generic linux-tools-$(uname -r)
I could never get it working. Updated my Kernal to newest stable version and tried to download the above packages from sudo apt-get install. I finally found the packages manually online, and it's working fine.
TL;DR: How can I get the right package for libmapscript-ruby1.8 on my system?
Context:
We have found an open source Rails 2.3 app that solves an internal tool problem.
https://github.com/timwaters/mapwarper
Additional instructions
https://github.com/l34marr/mapwarper/blob/master/README#L125
I've some experience with Rails but am just learning about the Ubuntu eco-system and apt-get.
Problem:
The perceived problem is that one of the external libraries (mapscript) is not functioning.
Further detail:
The perceived source of the problem is that apt-get install libmapscript-ruby1.8 does not seem to load a ruby1.8 version of mapscript. Instead it loads to /usr/lib/ruby/vendor_ruby/1.9.1/x86_64-linux/mapscript.so via dependencies of libmapscript-ruby1.8
So when the Rails app links to the installed mapscript.so, it breaks, since the syntax is presumably different between mapscript.so build for 1.8.7 and 1.9.1.
Example error (note 1.9.1 version of mapscript.so is copied into 1.8.7 folder here)
TypeError (wrong argument type swig_runtime_data (expected Struct)):
/home/ubuntu/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/x86_64-linux/mapscript.so
Contact with the application creator has been largely fruitless so far, since they have not encountered this specific issue.
There is a rubygem but it seems to also be for 1.9.1
https://github.com/sourcepole/ruby_mapscript
Is there some apt-get magic that I am missing? I've just read that something called backports exists but don't know if that is a solution.
I know it is an old threat, but in case someone else got this problem, I solved the problem like this:
(I used this github page: https://github.com/normanb/mapserver/tree/master/mapserver/mapscript)
Install old libgif
1.) apt install unzip libgdal-dev swig libproj-dev proj-data proj-bin
2.) wget "http://launchpadlibrarian.net/90361644/libgif4_4.1.6-9ubuntu1_amd64.deb"
3.) sudo dpkg -i libgif4_4.1.6-9ubuntu1_amd64.deb
4.) wget "http://security.ubuntu.com/ubuntu/pool/main/g/giflib/libgif-dev_4.1.6-9ubuntu1_amd64.deb"
5.) sudo dpkg -i libgif-dev_4.1.6-9ubuntu1_amd64.deb
Install old GD
6.) wget "www.boutell.com/gd/http/gd-2.0.33.tar.gz"
7.) unzip
8.) go to folder
9.) ./configure
10.) make
11.) make install
Install webserver
12.) Download zip from https://github.com/normanb/mapserver/
13.) unzip mapserver-master.zip
14.) Goto folder mapserver-master/mapserver/
15.) ./configure --with-wmsclient --with-proj --with-gdal --with-postgis (choose the options you need for your mapscript)
16.) make
For ruby mapscript: (for others chech out https://github.com/normanb/mapserver/tree/master/mapserver/mapscript)
16.) ruby extconf.rb
17.) make
18.) make install
Please note that there is a bug in set filter and you need to comment the filter like so "\"id = 123\"" (https://github.com/mapserver/mapserver/issues/3983)
Ultimately, it appears that the packages are (for my intent and purposes) broken.
Paired with a Debian guru, who basically installed Mapserver on the system in order to compile and generate the correct mapscript.so
He recommended I get in touch with the various package maintainers and outline the problems that I encountered.
I have been trying some different java compilers over the weekend and decided to stick with javac this morning. I then proceeded to clean up the mess that was caused by my testing and removed every last trace of java and did a fresh 'apt-get install openjdk-6-jdk' after autoremove and autoclean.
The following weirdness was then encountered:
tarskin#5-PARA-11-0120:~$ javac
The program 'javac' can be found in the following packages:
* openjdk-6-jdk
* ecj
* gcj-4.4-jdk
* gcj-4.6-jdk
* gcj-4.5-jdk
* openjdk-7-jdk
Try: sudo apt-get install <selected package>
I had allready installed openjdk but i tried it anyhow yielding:
tarskin#5-PARA-11-0120:~$ sudo apt-get install openjdk-6-jdk
[sudo] password for tarskin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-6-jdk is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
tarskin#5-PARA-11-0120:~$
I know i must be doing something stupid but I have no idea what, if anyone else could give a pointer in the right direction that would be very much appreciated...
Cheers
EDIT: Found some other weird aspects about the 'new' instance of my java distro, it doesn't seem to recognise for example 'Pattern' or 'Matcher' that should be coming from the regex import shrugs.
TL;DR: install java-1.6.0-openjdk-devel
I had a similar issue on Fedora, but used rpm -q -l to list the contents of the (pre-installed) java-1.6.0-openjdk package, and discovered that it doesn't include javac. It is in fact only a JRE, not a JDK, as implied by the installation instructions on http://openjdk.java.net/install/ . To get javac, I installed java-1.6.0-openjdk-devel . Not exactly what I expected, because the usual packaging conventions would indicate that is the package for doing openjdk development (i.e., working on the JVM), not for developing programs with it.
Basically, openjdk's package naming doesn't follow either standard Java conventions (would require calling it a JRE somewhere), or standard Linux packaging conventions (using -devel indicates it is used for developing the package w/o -devel itself).
As per http://openjdk.java.net/install/, to install the OpenJDK-6 JRE only:
$ sudo apt-get install openjdk-6-jre
To install the full JDK:
$ sudo apt-get install openjdk-6-jdk
Check /etc/alternatives and /usr/bin. One or both will contain links to old Java versions which you had installed. When those links are broken, you can get the error message above.
To update the links after installing a new version of Java, try update-alternatives
First to check if javac is installed try to look for that file:
1. locate javac
2. or find / -name javac
And also you can check at this website with instrucions on how to install java on Ubuntu (i suppose you are on ubuntu):
http://openjdk.java.net/install/
You can also check:
http://packages.ubuntu.com/hardy/i386/openjdk-6-jdk/filelist for the files installed by the pacakge, and you can notice that javac should be installed.
Maybe you also need to run:
Open the terminal and run this command to install OpenJDK 7.0 on Ubuntu Oneiric:
sudo update-alternatives --config java