poetry not install pyqt5-plugins - python-poetry

my first problem, did not install pyqt-tools, because current version pyqt-tools dependents pyqt5 version 5.15.4. Ok. I install this version and retray install pyqt-tools, but now, poetry print thise error:
Unable to find installation candidates for pyqt5-plugins (5.15.4.2.2)
my pyproject.toml
[tool.poetry]
name = "imageengine"
version = "0.1.0"
description = "Simple image engine application for linux"
authors = ["Code Man"]
license = "GPLv3"
readme = "README.md"
[tool.poetry.dependencies]
python = "3.11"
pyqt5 = "5.15.4"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
my poetry info
Version: 1.2.2
Poetry-Core Version: 1.4.0
i tried found about this problem, but not founded...
Using version ^5.15.4.3.2 for pyqt5-tools
Updating dependencies
Resolving dependencies... (0.1s)
Package operations: 2 installs, 0 updates, 0 removals
• Installing pyqt5-plugins (5.15.4.2.2): Failed
RuntimeError
Unable to find installation candidates for pyqt5-plugins (5.15.4.2.2)
at /usr/lib/python3.10/site-packages/poetry/installation/chooser.py:103 in choose_for
99│
100│ links.append(link)
101│
102│ if not links:
→ 103│ raise RuntimeError(f"Unable to find installation candidates for {package}")
104│
105│ # Get the best link
106│ chosen = max(links, key=lambda link: self._sort_key(package, link))
107│

Related

Poetry creates new pyproject.toml with wrong python version

I am using pyenv to select python 3.10.9:
pyenv global 3.10.9
python --version
Python 3.10.9
Poetry configuration file shows that Poetry should use the current python version:
(base) bob#Roberts-Mac-mini shims % poetry config --list (amended)
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.prefer-active-python = true
but when I create a new poetry project:
poetry new --src newproject
in the generated pyproject.toml the python version is 3.11, which is the version that was active when I installed poetry itself (file amended):
(base) bob#Roberts-Mac-mini newproject % cat pyproject.toml
[tool.poetry]
name = "newproject"
version = "0.1.0"
description = ""
authors = ["XXXX YYYYYY <ZZZZZZZZZZ#gmail.com>"]
readme = "README.md"
packages = [{include = "newproject", from = "src"}]
[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
I see there's an experimental poetry setting: https://python-poetry.org/docs/configuration/#virtualenvsprefer-active-python-experimental
Are there hidden problems using it?
The other solution I can think of is editing the pyproject.toml file, change python to 3.10 and then use "poetry env use 3.10" to create the venv with 3.10. Is this ok?
Are there other solutions to force the new environment to 3.10.9?

Version of a built `conda-forge` package is different between `pip list` and the `conda list` (it should be the same)

I recently added the package typepigeon to conda-forge. On conda-forge it is currently at version 1.0.9; however, when installing typepigeon via conda install, the output of pip list shows its version to be 0.0.0.post2.dev0+a27ab2a instead of 1.0.9.
conda list:
typepigeon 1.0.9 pyhd8ed1ab_0 conda-forge
pip list:
typepigeon 0.0.0.post2.dev0+a27ab2a
I think the issue arises from the way I am assigning the version (I am using dunamai to extract the Git tag as the version number). This version extraction is done within setup.py of typepigeon.
try:
__version__ = Version.from_any_vcs().serialize()
except RuntimeError as error:
warnings.warn(f'{error.__class__.__name__} - {error}')
__version__ = '0.0.0'
When conda-forge builds the feedstock, I think it might be looking at the Git tag of the feedstock repository instead of the version from PyPI (as it is locally executing setup.py).
How can I modify the Conda Forge recipe to force the PyPI version?
I've figured out a solution; it might not be the best possible way to do this, but it works for my workflow.
I injected the version into the setup.py by looking for an environment variable (that I called __version__):
if '__version__' in os.environ:
__version__ = os.environ['__version__']
else:
from dunamai import Version
try:
__version__ = Version.from_any_vcs().serialize()
except RuntimeError as error:
warnings.warn(f'{error.__class__.__name__} - {error}')
__version__ = '0.0.0'
Then, in the conda-forge recipe, I added an environment variable (__version__) to the build step:
build:
noarch: python
script: export __version__={{ version }} && {{ PYTHON }} -m pip install . -vv

Poetry sees an indirect dependency (numpy for python) is outdated, but doesn't update it

Trying out poetry 1.1.11 and have pandas in my pyproject.toml in the tool.poetry.dependencies section. Pandas depends on numpy
pandas 1.3.3 Powerful data structures for data analysis, time series, and statistics
├── numpy >=1.17.3
├── python-dateutil >=2.7.3
│ └── six >=1.5
└── pytz >=2017.3
When I called poetry add pandas it correctly installed numpy 1.21.1. Numpy has bumped to 1.22.2 and poetry recognizes this
poetry show --outdated
numpy 1.21.1 1.21.2 NumPy is the fundamental package for array computing with Python.
But numpy isn't updated by poetry.
poetry update
Updating dependencies
Resolving dependencies... (0.3s)
No dependencies to install or update
Is this expected? How / when would numpy be updated?
EDIT2: per #finswimmer's request, here's the TOML and for a simpler case than in the first EDIT TOML. It's an empty project from poetry new. Then try poetry add numpy as below.
Just
[tool.poetry]
name = "delete_me4"
version = "0.1.0"
description = ""
authors = ["Your Name <you#example.com>"]
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.dev-dependencies]
pytest = "^5.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
❯ poetry add numpy
Using version ^1.21.2 for numpy
Updating dependencies
Resolving dependencies... (0.0s)
SolverProblemError
The current project's Python requirement (>=3.9,<4.0) is not compatible with some of the required packages Python requirement:
- numpy requires Python >=3.7,<3.11, so it will not be satisfied for Python >=3.11,<4.0
Because numpy (1.21.2) requires Python >=3.7,<3.11
and no versions of numpy match >1.21.2,<2.0.0, numpy is forbidden.
So, because delete-me4 depends on numpy (^1.21.2), version solving failed.
at ~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/puzzle/solver.py:241 in _solve
237│ packages = result.packages
238│ except OverrideNeeded as e:
239│ return self.solve_in_compatibility_mode(e.overrides, use_latest=use_latest)
240│ except SolveFailure as e:
→ 241│ raise SolverProblemError(e)
242│
243│ results = dict(
244│ depth_first_search(
245│ PackageNode(self._package, packages), aggregate_package_nodes
• Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
For numpy, a possible solution would be to set the `python` property to ">=3.9,<3.11"
https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
https://python-poetry.org/docs/dependency-specification/#using-environment-markers
The suggestion in the help text above addresses the issue. poetry add numpy works in an empty project with this TOML change.
[tool.poetry.dependencies]
python = ">=3.9,<3.11"
I'm not sure what triggered it wanting Python >= 3.11 descoped, but hey. It solved the problem for me once I tried the repro.
Note that constraining Python further as follows allows for scipy to move from 1.6.1 to 1.7.1
[tool.poetry.dependencies]
python = ">=3.9,<3.10"

how do I update xarray?

How can I update xarray? I tried:
>>> import xarray
>>> xarray.show_versions
<function show_versions at 0x7fcfaf2aa820>
But I cannot find any documentation how to read this, or how to update to a new version of xarray.
I was not the person to install it on the computer, so I do not know if it was through anaconda or something else. Is there a way to find this out?
xarray.show_versions is a function, which prints the versions of xarray and its dependencies.
To get just the version of xarray, you can check the __version__ property of the module.
Updating xarray is best done with pip or conda, depending on how you installed it in the first place.
import xarray as xr
print(xr.__version__)
# '0.18.2'
xr.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.8.8 (default, Feb 19 2021, 18:07:06)
[GCC 8.3.0]
python-bits: 64
OS: Linux
OS-release: 5.11.0-27-generic
machine: x86_64
processor:
byteorder: little
LC_ALL: C.UTF-8
LANG: C.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: 1.12.0
libnetcdf: 4.7.4
xarray: 0.18.2
pandas: 1.2.4
numpy: 1.20.3
scipy: 1.6.3
netCDF4: 1.5.6
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.8.3
cftime: 1.5.0
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.3
cfgrib: None
iris: None
bottleneck: 1.3.2
dask: 2021.05.0
distributed: 2021.05.0
matplotlib: 3.4.2
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 53.0.0
pip: 21.1.1
conda: None
pytest: None
IPython: 7.23.1
sphinx: None
To update xarray:
pip install --upgrade xarray
or
conda update xarray
To see if it was installed using conda or pip, run conda list xarray. If it was installed using pip, it should state pypi in the Channel column.
This is for those who want to do through GUI and who use software like pycharm, spyder, or other similar softwares.
SO, try finding 'python interpreter' in the settings. Most softwares shows the existing packages, current version,latest version(for example see the image of pycharm)
There is option to select the version that you want. for example there are times, when a module is in its beta phase and is not stable in usage. so, you can specify the latest stable version too. It is applicable for any module and not limited to xarray.

Anaconda: Installing package raises UnsatisfiableError on itself

I'm trying to build a new conda package. I used conda skeleton to create a meta.yaml file which I edited to my needs:
package:
name: ofl
version: "master"
source:
git_url: git#github.com:fergalm/Fireworks.git
git_tag: master
build:
# noarch: python
# preserve_egg_dir: True
entry_points:
# Put any entry points (scripts to be generated automatically) here. The
# syntax is module:function. For example
#
# - pyinstrument = pyinstrument:main
#
# Would create an entry point called pyinstrument that calls pyinstrument.main()
# If this is a new build for the same version, increment the build
# number. If you do not include this key, it defaults to 0.
# number: 1
requirements:
build:
- python
- setuptools
run:
- python
- boto3
- yaml
- dateutil
I can build this package with conda-build ofl, but when I try to install it with conda install ofl --use-local I get the following error
Fetching package metadata .............
Solving package specifications: .
UnsatisfiableError: The following specifications were found to be in conflict:
- ofl
Use "conda info <package>" to see the dependencies for each package.
What does it mean for my package, ofl, to be in conflict with itself? What do I need to do to fix this?

Resources