error installing python packages uisng pip - python

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?

Related

Problem getting python to "find" the pyglet module

I am learning python via a Great Course lecture series, and in the second half of the course need to install the pyglet module. Although I have (apparently) downloaded the module successfully, my PyCharm IDE is not able to locate it, so my .py program with the instruction "import pyglet" generates the following error:
"C:\Users\the_m\PycharmProjects\Program 1\venv\Scripts\python.exe" "C:\Users\the_m\PycharmProjects\Program 1\basketball.py"
Traceback (most recent call last):
File "C:\Users\the_m\PycharmProjects\Program 1\basketball.py", line 1, in <module>
import pyglet
ModuleNotFoundError: No module named 'pyglet'
I am really enjoying the course, and enjoying getting back to coding after a multi-decade hiatus. I am working on a PC. Can anyone suggest a solution?
file locations for python and what I think are the pyglet module are as follows:
C:\Users\the_m>py -m pip --version
pip 23.0 from C:\Users\the_m\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
C:\Users\the_m>py -m pip install --upgrade pip setuptools wheel
Requirement already satisfied: pip in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (23.0)
Requirement already satisfied: setuptools in c:\users\the_m\appdata\local\programs\python\python311\lib\site-packages (65.5.0)
Collecting setuptools
Downloading setuptools-67.2.0-py3-none-any.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 607.4 kB/s eta 0:00:00
Collecting wheel
Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, setuptools
WARNING: The script wheel.exe is installed in 'C:\Users\the_m\AppData\Local\Programs\Python\Python311\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Attempting uninstall: setuptools
Found existing installation: setuptools 65.5.0
Uninstalling setuptools-65.5.0:
Successfully uninstalled setuptools-65.5.0
Successfully installed setuptools-67.2.0 wheel-0.38.4

Getting error on installing a python package regarding mysqlclient

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.

pip install PyQt6 fails: module 'sipbuild.api' has no attribute 'prepare_metadata_for_build_wheel'

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?

How to use or install pycocoevalcap?

I'm new to use coco Datasets .. i got this error
# this requires the coco package, Link
from pycocoevalcap.bleu.bleu import Bleu
from pycocoevalcap.rouge.rouge import Rouge
from pycocoevalcap.cider.cider import Cider
ModuleNotFoundError: No module named 'pycocoevalcap'
i downloaded coco package with the given Link and tried to use pip3 install pycocoevalcap
but got
ERROR: Could not find a version that satisfies the requirement pycocoevalcap (from versions: none)
ERROR: No matching distribution found for pycocoevalcap
How can i fix it
So I used this command:
pip install "git+https://github.com/salaniz/pycocoevalcap.git"
and it returned
Collecting git+https://github.com/salaniz/pycocoevalcap.git
Cloning https://github.com/salaniz/pycocoevalcap.git to /tmp/pip-req-build-3u0sbfzy
Running command git clone -q https://github.com/salaniz/pycocoevalcap.git /tmp/pip-req-build-3u0sbfzy
Collecting pycocotools>=2.0.0
...
Successfully built pycocoevalcap pycocotools
Installing collected packages: cython, pycocotools, pycocoevalcap.
Successfully installed cython-0.29.20 pycocoevalcap-1.1 pycocotools-2.0.1

Jnius installation bug, "Unable to determine JDK_HOME"

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.

Categories

Resources