I am currently working on a new project. Trying to install the requirements using pip but getting this error. Using python version 3.6.9
This is the error message I am getting.
Collecting en-core-web-sm# https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.0/en_core_web_sm-3.4.0-py3-none-any.whl
Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.0/en_core_web_sm-3.4.0-py3-none-any.whl (12.8 MB)
|████████████████████████████████| 12.8 MB 5.9 MB/s
ERROR: mysqlclient-1.4.6-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
Error log on - https://dpaste.org/U7F7g
Any help would be highly appreciated and thank you in advance to anyone who looks into this.
You need to install a different version of the mysqlclient wheel that is compatible with your version of Python.
Related
i removed python 3.10.5 and installed 3.11 and tried installing pandas package using pip
but i am getting an error like this:
C:\Users\Koushik Reddy>pip install numpy
Collecting numpy
Downloading numpy-1.23.4-cp311-cp311-win_amd64.whl (14.6 MB)
━━━╸━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/14.6 MB 468.8 kB/s eta 0:00:29
ERROR: Wheel 'numpy' located at C:\Users\.....\AppData\Local\Temp\pip-unpack-4o7ub4mx\numpy-1.23.4-cp311-cp311-win_amd64.whl is invalid.
can any one tell me what is causing this error?
Installing PyQt6 on a Linux Mint box fails with this error:
AttributeError: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'
The same error is mentioned in several posts, sometimes for PyQt6, sometimes for other modules. However, none of the proposed solutions (like upgrading pip) seems to work.
Any suggestions on how to figure out what is wrong?
Below are the commands I used. Installation is in a virtual environment (but installing it on the main machine results in the same error).
johan#morla:~/work\> cat /etc/issue
Linux Mint 19 Tara \n \l
johan#morla:~/work\> python --version
Python 3.9.12
johan#morla:~/work\> python -m venv env
johan#morla:~/work\> . env/bin/activate
johan#morla:~/work\> pip list
Package Version
---------- -------
pip 22.1
setuptools 58.1.0
johan#morla:~/work\> pip install PyQt6
Collecting PyQt6
Using cached PyQt6-6.3.0-cp37-abi3-manylinux1_x86_64.whl (7.8 MB)
Collecting PyQt6-sip<14,>=13.2
Using cached PyQt6_sip-13.3.1-cp39-cp39-manylinux1_x86_64.whl (306 kB)
Collecting PyQt6
Using cached PyQt6-6.2.3-cp36-abi3-manylinux1_x86_64.whl (7.7 MB)
Using cached PyQt6-6.2.2-cp36-abi3-manylinux1_x86_64.whl (7.7 MB)
Using cached PyQt6-6.2.1-cp36-abi3-manylinux1_x86_64.whl (7.7 MB)
Using cached PyQt6-6.2.0.tar.gz (1.0 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
Querying qmake about your Qt installation...
/usr/bin/qmake -query
Traceback (most recent call last):
File "/home/johan/work/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, 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'
Based on #eyllanesc's input: the problem is that PyQt6 depends on pyqt6-qt6, and the currently available wheels for pyqt6-qt6 require glibc version 2.28 or greater. As I am using Linux Mint 19 which has glibc 2.27, pip tries to build from source, which fails.
Hint: to check the glibc version, try ldd --version
Solution: upgrade Mint, or wait until #eyllanesc has a solution with an older glibc (or try to compile it myself).
Is there a way to get pip to give a clearer error message?
I tried to install jnius Python module by typing 'pip install jnius' in CMD.
This is the message I got:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\setup.py", line 111, in <module>
raise Exception('Unable to determine JDK_HOME')
Exception: Unable to determine JDK_HOME
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\sm\appdata\local\temp\pip-install-vu2sb5\jnius\
I restarted CMD, but it didn't help.
I have finally resolved it. I have installed Cython before this happened and I installed both Java JDK and JRE after #Chris comment. And I have also added JAVA_HOME and JDK_HOME to system variables.Thank you #Chris, but it didn't resolve problem completely.
Then I got another error message. There was written that I have to install Microsoft Visual C++ Compiler for Python 2.7 from this page:
https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266
After that I tried to install jnius again but the error message said that permission is denied so I ran CMD as administrator and finally installed jnius by typing pip install jnius.
I spent a lot of time to resolve it and hope that it will help everyone with same or similar problem.
I have resolved the problem in windows os.
1st step:
I have installed cython by using pip install cython
C:\Users>pip install cython
Collecting cython
Downloading Cython-0.29.22-cp38-cp38-win_amd64.whl (1.7 MB)
|████████████████████████████████| 1.7 MB 1.3 MB/s
Installing collected packages: cython
Successfully installed cython-0.29.22
2nd step:
I have installed jnius by using pip install pyjnius command
C:\Users>pip install pyjnius
Collecting pyjnius
Downloading pyjnius-1.3.0-cp38-cp38-win_amd64.whl (226 kB)
|████████████████████████████████| 226 kB 3.2 MB/s
Requirement already satisfied: cython in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (0.29.22)
Requirement already satisfied: six>=1.7.0 in c:\users\sss\appdata\local\programs\python\python38\lib\site-packages (from pyjnius) (1.15.0)
Installing collected packages: pyjnius
Successfully installed pyjnius-1.3.0
I hope this solves your problem.
The thing that worked for me was simply adding JAVA_HOME and JDK_HOME variables.
On a production server, I am forced to use python3.2. Sadly several of my dependencies require >=python3.4.
Is there a way to find out what the latest version of a package is that can be used with a specific python version?
For instance, with python3.2, what version of numpy should be used?
(This is only an example, answers would ideally not focus on the example, but on the actual question).
Perhaps you could use environment markers to solve the problem?
These are strings that can be used in requirements.txt and setup.py files (under the install_requires argument) and look like:
numpy>=1.7,<2; python_version > '3.4'
numpy>=1.7,<1.12; python_version < '3.4'
They can help you match packages to Python versions with some flexibility.
This should work with pip>=22.2 (tested with Python 3.10.8 + pip 22.2.2) and give you the latest version of a package compatible with a given Python version:
python -m pip install numpy --dry-run --python-version 3.2 --no-deps --target foo
Output:
Collecting numpy
Downloading numpy-1.12.1.zip (4.8 MB)
---------------------------------------- 4.8/4.8 MB 3.6 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Would install numpy-1.12.1
Extracted from this answer.
You can go to individual package and check requirement. Like for Numpy you can check on github which tells Python version 2.7 or >= 3.4 required.
I've been programming with Python for a few months now but I'm having trouble figuring out the Python-Twitch library for the Twitch API. I've installed version 1.2 and it gives instructions here: http://ingwinlu.github.io/python-twitch/quickstart.html#dependencies
However, I'm completely inexperienced with doing this type of thing. Even just using their example of
from twitch.api import v3
returns a "no module named twitch" error..
Where would I get started with this? Any help would be greatly appreciated, sorry for my lack of knowledge.
If calling from twitch.api import v3 returns the following error:
no module named twitch
Then you do not have the python-twitch module properly installed.
First make sure you have an up to date version of Python, such as 3.5.1 from https://www.python.org/downloads/
Then install it (if not already installed) using the recommended options including PIP
Then go to the Python\Scripts directory, such as:
C:\Users\me\AppData\Local\Programs\Python\Python35-32\Scripts>
Then run the following:
pip install python-twitch
Now you should see something like this:
Collecting python-twitch
Downloading python-twitch-1.2.0.tar.gz
Collecting six>=1.9.0 (from python-twitch)
Downloading six-1.10.0-py2.py3-none-any.whl
Installing collected packages: six, python-twitch
Running setup.py install for python-twitch
Successfully installed python-twitch-1.2.0 six-1.10.0\
Now re-run your test python file:
from twitch.api import v3