how to install requirement with pip - python

I have a problem with pip. I have created my enviroment by miniconda. I have run this command
conda env create --file enviroment.yml
enviroment.yml
name: data-science-handbook
channels:
- conda-forge
dependencies:
- python=3.10
requirements.txt
numpy==1.11.1
pandas==0.18.1
scipy==0.17.1
scikit-learn==0.17.1
scikit-image==0.12.3
pillow==3.4.2
matplotlib==1.5.1
seaborn==0.7.0
jupyter
notebook
line_profiler
memory_profiler
numexpr
pandas-datareader
netcdf4
I have searched google for a couple of hours, but I have not solved.
After run pip install -r requirements.txt
Collecting numpy==1.11.1
Downloading numpy-1.11.1.zip (4.7 MB)
---------------------------------------- 4.7/4.7 MB 6.3 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting pandas==0.18.1
Downloading pandas-0.18.1.zip (8.5 MB)
---------------------------------------- 8.5/8.5 MB 9.2 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting scipy==0.17.1
Downloading scipy-0.17.1.zip (13.8 MB)
---------------------------------------- 13.8/13.8 MB 9.8 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting scikit-learn==0.17.1
Downloading scikit-learn-0.17.1.tar.gz (7.9 MB)
---------------------------------------- 7.9/7.9 MB 10.1 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting scikit-image==0.12.3
Downloading scikit-image-0.12.3.tar.gz (20.7 MB)
---------------------------------------- 20.7/20.7 MB 8.2 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [5 lines of output]
To install scikit-image from source, you will need numpy.
Install numpy with pip:
pip install numpy
Or use your operating system package manager. For more
details, see http://scikit-image.org/docs/stable/install.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
I tried install with conda. conda install --file requirements.txt and still error
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
PackagesNotFoundError: The following packages are not available from current channels:
- matplotlib==1.5.1
- scikit-image==0.12.3
- pandas==0.18.1
- scikit-learn==0.17.1
- numpy==1.11.1
- pillow==3.4.2
- scipy==0.17.1
- seaborn==0.7.0
Current channels:
- https://repo.anaconda.com/pkgs/main/win-64
- https://repo.anaconda.com/pkgs/main/noarch
- https://repo.anaconda.com/pkgs/r/win-64
- https://repo.anaconda.com/pkgs/r/noarch
- https://repo.anaconda.com/pkgs/msys2/win-64
- https://repo.anaconda.com/pkgs/msys2/noarch
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
How can i fix it? please help me. Thanks

Related

kivy install fails on github-actions while runs-on:windows-latest

I am trying to automate building binaries for windows from the python program that depends on kivy. The manual build for Linux and windows is available at FormHelper.
While building for windows with GitHub actions the action fails to install kivy.
kivy install fails on Github-actions while runs-on:windows-latest
Github actions workflow
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: compile-source-windows
on:
push:
branches: [main, master]
paths:
- "**/src/*.py"
- "**/src/*.bat"
- "**/src/*.sh"
- "**/compile-source-windows.yml"
workflow_dispatch:
# on: workflow_dispatch
defaults:
run:
working-directory: "./source/01FormHelper/src/"
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout#v3
- uses: actions/setup-python#v4
with:
python-version: "3.10"
- name: update pip and install python modules in pipenv
run: |
python -V
pip install -U pip
pip install pipenv
pip install Kivy
pip install kivy pyinstaller beautifulsoup4 setuptools cython
pipenv install cython
pipenv install kivy
pipenv install Kivy
it works on ubuntu-latest
error log
Installing kivy...
Error: An error occurred while installing kivy!
Error text: Collecting kivy
Downloading Kivy-2.1.0.tar.gz (23.8 MB)
--------------------------------------- 23.8/23.8 MB 28.4 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
� pip subprocess to install build dependencies did not run successfully.
\u2502 exit code: 1
\u2570\u2500> [13 lines of output]
Collecting setuptools
Downloading setuptools-66.1.1-py3-none-any.whl (1.3 MB)
---------------------------------------- 1.3/1.3 MB 26.6 MB/s eta
0:00:00
Collecting wheel
Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
Downloading Cython-0.29.28-py2.py3-none-any.whl (983 kB)
------------------------------------- 983.8/983.8 kB 20.7 MB/s eta
0:00:00
Collecting kivy_deps.gstreamer_dev~=0.3.3
Downloading kivy_deps.gstreamer_dev-0.3.3-cp311-cp311-win_amd64.whl
(3.9 MB)
---------------------------------------- 3.9/3.9 MB 35.2 MB/s eta
0:00:00
ERROR: Could not find a version that satisfies the requirement
kivy_deps.sdl2_dev~=0.4.5 (from versions: 0.5.1)
ERROR: No matching distribution found for kivy_deps.sdl2_dev~=0.4.5
note: This error originates from a subprocess, and is likely not a problem
with pip.
error: subprocess-exited-with-error
� pip subprocess to install build dependencies did not run successfully.
\u2502 exit code: 1
\u2570\u2500> See above for output.
note: This error originates from a subprocess, and is likely not a problem with
pip.
Installation Failed
Installing Kivy...
Error: An error occurred while installing Kivy!
Error text: Collecting kivy
Using cached Kivy-2.1.0.tar.gz (23.8 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
error: subprocess-exited-with-error
� pip subprocess to install build dependencies did not run successfully.
\u2502 exit code: 1
\u2570\u2500> [10 lines of output]
Collecting setuptools
Using cached setuptools-66.1.1-py3-none-any.whl (1.3 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
Collecting kivy_deps.gstreamer_dev~=0.3.3
Using cached kivy_deps.gstreamer_dev-0.3.3-cp311-cp311-win_amd64.whl
(3.9 MB)
ERROR: Could not find a version that satisfies the requirement
kivy_deps.sdl2_dev~=0.4.5 (from versions: 0.5.1)
ERROR: No matching distribution found for kivy_deps.sdl2_dev~=0.4.5
note: This error originates from a subprocess, and is likely not a problem
with pip.
error: subprocess-exited-with-error
� pip subprocess to install build dependencies did not run successfully.
\u2502 exit code: 1
\u2570\u2500> See above for output.
note: This error originates from a subprocess, and is likely not a problem with
pip.
Installation Failed

Unable To Install Kivy

pip install kivy
Collecting kivy
Using cached Kivy-2.1.0.tar.gz (23.8 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Collecting setuptools
Using cached setuptools-65.5.1-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
Using cached Cython-0.29.28-py2.py3-none-any.whl (983 kB)
Collecting kivy_deps.gstreamer_dev~=0.3.3
Using cached kivy_deps.gstreamer_dev-0.3.3-cp311-cp311-win_amd64.whl (3.9 MB)
ERROR: Could not find a version that satisfies the requirement kivy_deps.sdl2_dev~=0.4.5 (from versions: 0.5.1)
ERROR: No matching distribution found for kivy_deps.sdl2_dev~=0.4.5
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
from their docs
Kivy 2.1.0 officially supports Python versions 3.7 - 3.10.
you are using 3.11. Try using python 3.10
(although from your prints it looks like they are in the process of supporting 3.11 (since it could install other kivy specific requirements for 3.11))

Trying to download/install any python libraries

So I'm working on an app in VS Code and I'm trying to install the (pillow) and (kivy) libraries in python and I always get this same error. Does anyone have any answers to this. It would be greatly appreciated!!
The first line below is what I type into the terminal in VS Code.
python -m pip install kivy[full]
Collecting kivy[full]
Downloading Kivy-2.1.0.tar.gz (23.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 23.8/23.8 MB 7.5 MB/s eta 0:00:00
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [9 lines of output]
Collecting setuptools
Using cached setuptools-65.5.0-py3-none-any.whl (1.2 MB)
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting cython!=0.27,!=0.27.2,<=0.29.28,>=0.24
Downloading Cython-0.29.28-py2.py3-none-any.whl (983 kB)
-------------------------------------- 983.8/983.8 kB 3.9 MB/s eta 0:00:00
ERROR: Could not find a version that satisfies the requirement kivy_deps.gstreamer_dev~=0.3.3 (from versions: none)
ERROR: No matching distribution found for kivy_deps.gstreamer_dev~=0.3.3
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Everything listed above!
Looks like you’re missing some gstreamer libraries that Kivy depends on. A quick google search led me to the PyPi package that matches what it’s asking for. Looks like the current version is 0.4 so you will need to specify 0.3.3 when you install via pip. PyPi package: gstreamer dep
Edit: Here is the exact version with the pip install command. Hope this helps.

fail installing keybert on python 3.10.4

I'm trying to install keybert on python 3.10.4, but it fails on the installation of the scikit-learn library stating a dependencies confilc on Numpy as below:
ScreenShot of CMD terminal
Using cached meson-0.62.2-py3-none-any.whl (864 kB)
Collecting Cython<3.0,>=0.29.21
Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
Collecting pybind11<2.11.0,>=2.4.3
Using cached pybind11-2.10.0-py3-none-any.whl (213 kB)
Collecting pythran<0.12.0,>=0.9.12
Using cached pythran-0.11.0-py3-none-any.whl (4.2 MB)
Collecting wheel<0.38.0
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting numpy==1.22.3
Using cached numpy-1.22.3-cp310-cp310-win32.whl (12.2 MB)
ERROR: Cannot install numpy==1.21.6 and numpy==1.22.3 because these package versions have conflicting dependencies.
The conflict is caused by:
The user requested numpy==1.22.3
The user requested numpy==1.21.6
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I have tried to do it in a new virtual env but same.
Tried to install Numpy 1.22.3 first, then the sciKit-learn library independently but I'm getting the same dependencies conflict over and over.
How to resolve this problem?

f2py: require specific numpy version during creation of binary wheel

We are publishing binry wheels for a python package on PyPi. The package has a Fortran extension which we produce with f2py.
Our problem is that the CI images (Gitlab CI for Linux and Appveyor for Windows) tend to have the newest numpy version. Then, when the user installs the binary wheel, the Fortran extension will fail unless the user also has the newest numpy version.
This problem was also described in this SO question.
The proposed solution in the accepted answer was to add a pyproject.toml file containing an older numpy version as a build dependency, like this:
[build-system]
requires = ['numpy==1.15', 'setuptools', 'wheel']
build-backend = "setuptools.build_meta"
and then to require at least that version on the user machine through the install_requires in setup.py, like `'numpy>=1.12.2'.
I tried that, but now it seems that in the Gitlab CI, pip again installs the newest numpy version, which is what I wanted to avoid in the first place.
A part of the output is copied below. In the first lines it says Installing build dependencies and I assume it installs numpy 1.15 then. But later, it says Collecting numpy>=1.15 and Using cached numpy-1.20.1-cp37-cp37m-manylinux2010_x86_64.whl (15.3 MB). So, it doesn't keep the previously installed numpy 1.15 (if any) but overwrites it with the newest version.
My question is, how can I avoid that and make sure that exactly numpy 1.15 is used for the creation of the binary wheel?
$ pip3 install -e .
Obtaining file:///builds/AmosEgel/smuthi
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
Collecting mpmath
Downloading mpmath-1.2.1-py3-none-any.whl (532 kB)
Collecting psutil
Downloading psutil-5.8.0-cp37-cp37m-manylinux2010_x86_64.whl (296 kB)
Collecting imageio
Downloading imageio-2.9.0-py3-none-any.whl (3.3 MB)
Collecting scipy
Downloading scipy-1.6.2-cp37-cp37m-manylinux1_x86_64.whl (27.4 MB)
Collecting pycparser
Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
Collecting argparse
Downloading argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting sympy
Downloading sympy-1.7.1-py3-none-any.whl (5.9 MB)
Collecting matplotlib
Downloading matplotlib-3.3.4-cp37-cp37m-manylinux1_x86_64.whl (11.5 MB)
Collecting tqdm
Downloading tqdm-4.59.0-py2.py3-none-any.whl (74 kB)
Collecting h5py
Downloading h5py-3.2.1-cp37-cp37m-manylinux1_x86_64.whl (4.1 MB)
Collecting pywigxjpf
Downloading pywigxjpf-1.11.tar.gz (54 kB)
Collecting numba
Downloading numba-0.53.0-cp37-cp37m-manylinux2014_x86_64.whl (3.4 MB)
Collecting pyyaml
Downloading PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (636 kB)
Collecting numpy>=1.15
Using cached numpy-1.20.1-cp37-cp37m-manylinux2010_x86_64.whl (15.3 MB)
Ok, the problem was that one of the other requirements (in our case, h5py) required a more recent version of numpy.

Categories