Version conflict when using buildout.plonetest 4.3.x - plone

I wrote a small module that extends https://raw.github.com/collective/buildout.plonetest/master/test-4.2.x.cfg. If I change the version from 4.2 to 4.3 it throws the error when running bin/buildout:
...
While:
Installing.
Getting section test.
Initializing section test.
Installing recipe zc.recipe.testrunner.
Error: There is a version conflict.
We already have: zc.recipe.egg 2.0.0
I suppose that the error is produced because some packages listed in the buildout.plonetest have conflicting versions and that is a bug in the 4.3 version set. I'm right or I'm making a mistake in the buildout.cfg file?
The buildout that I'm using is:
[buildout]
extends =
https://raw.github.com/collective/buildout.plonetest/master/test-4.2.x.cfg
package-name = conaride.theme
package-extras = [test]
[instance]
eggs +=
Pillow
[test]
defaults = ['-s', '${buildout:package-name}', '--auto-color', '--auto-progress']

There is no bug in the 4.3 version set; you need to fix the version conflict. Try any or all of the following approaches to this very-common problem:
(1) Remove the already-downloaded version and re-run Buildout e.g.:
$ rm -rf eggs/zc.recipe.egg\*
$ bin/buildout
(2) Remove the installed config and re-run Buildout e.g.:
$ rm .installed.cfg
$ bin/buildout
(3) Specify the version you want to use in your local config e.g.
[versions]
zc.recipe.egg = 2.0.0

Related

Why is blogdown putting a mamba command through normalizePath?

Here's what I'm doing:
I have a blog that uses blogdown to render .Rmd files.
Some of the code snippets in the blog are in Python. I'm using reticulate for that.
I'm using a GitHub workflow to build and publish the blog as part of a larger website. This workflow sets up the environment and package dependencies in miniconda.
The last time this ran was six months ago. At that time, it worked. Now, it does not. I can't seem to replicate the behavior locally for more detailed debugging.
It seems to be trying to put a mamba command into normalizePath instead of a filesystem path (www-main is the name of the repository):
conda activate www-main
Rscript -e 'blogdown::build_site(local=FALSE, run_hugo=FALSE, build_rmd="content/blog/2020-08-28-api.Rmd")'
shell: /usr/bin/bash -l {0}
env:
CONDA_PKGS_DIR: /home/runner/conda_pkgs_dir
Rendering content/blog/2020-08-28-api.Rmd...
[...]
Quitting from lines 401-410 (2020-08-28-api.Rmd)
Error in normalizePath(conda, winslash = "/", mustWork = TRUE) :
path[1]="# cmd: /usr/share/miniconda/condabin/mamba update --name www-main --file /home/runner/work/www-main/www-main/conda": No such file or directory
Calls: local ... python_munge_path -> get_python_conda_info -> normalizePath
Execution halted
Error: Failed to render content/blog/2020-08-28-api.Rmd
Execution halted
Lines 401-410 of 2020-08-28-api.Rmd are a Python code block:
400 ```{python python-data, dev='svg'}
401 import covidcast
402 from datetime import date
403 import matplotlib.pyplot as plt
404
405 data = covidcast.signal("fb-survey", "smoothed_hh_cmnty_cli",
406 date(2020, 9, 8), date(2020, 9, 8),
407 geo_type="state")
408 covidcast.plot_choropleth(data, figsize=(7, 5))
409 plt.title("% who know someone who is sick, Sept 8, 2020")
410 ```
The useful bits of the output of conda info, in case it helps:
active environment : www-main
active env location : /usr/share/miniconda/envs/www-main
shell level : 1
user config file : /home/runner/.condarc
populated config files : /home/runner/.condarc
conda version : 4.12.0
conda-build version : not installed
python version : 3.9.12.final.0
virtual packages : __linux=5.15.0=0
__glibc=2.31=0
__unix=0=0
__archspec=1=x86_64
base environment : /usr/share/miniconda (writable)
conda av data dir : /usr/share/miniconda/etc/conda
conda av metadata url : None
channel URLs : https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/runner/conda_pkgs_dir
envs directories : /usr/share/miniconda/envs
/home/runner/.conda/envs
platform : linux-64
user-agent : conda/4.12.0 requests/2.27.1 CPython/3.9.12 Linux/5.15.0-1020-azure ubuntu/20.04.5 glibc/2.31
UID:GID : 1001:121
netrc file : None
offline mode : False
I found this, but their workaround doesn't make sense for me since I'm not using papermill: https://github.com/rstudio/reticulate/issues/1184
I found this, but my paths don't have spaces: https://github.com/rstudio/reticulate/issues/1149
I found this, but their problem includes an entirely reasonable value for path[1], unlike mine: How can I tell R where the conda environment is via a docker image?
The build environment for this is a bit of a bear but I can probably put together a minimum working (/nonworking) example if needed, lmk
I tracked this down to at least two bits of weird/buggy behavior in reticulate and found a workaround: switch from vanilla miniconda to Mambaforge.
The TL;DR seems to be that whatever wacky ubuntu-latest setup-miniconda#v2 environment started putting into meta/history doesn't include a create line, which is what reticulate needs in order to figure out which conda goes with which python, because (1) it ignores the reticulate.conda_binary setting for some reason, and (2) it uses a more restrictive regex to parse the lines of the history file than the regex it uses to select them. Mambaforge does include the create line, so reticulate is happy.
- uses: conda-incubator/setup-miniconda#v2
with:
python-version: 3.9
activate-environment: www-main
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
use-only-tar-bz2: true # (for caching support)
- name: Update environment
run: mamba env update -n www-main -f environment.yml

asp.net core 3 rotativa startup.cs env problem

Im try to use Rotativa ım follow this guide
in start.cs in configure function ım add this code
RotativaConfiguration.Setup(env);
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Hosting.IWebHostEnvironment' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'
ım search this error and find this and convert my code like this
RotativaConfiguration.Setup(env.WebRootPath, "Rotativa");
and its give me this error
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'string' to 'Microsoft.AspNetCore.Hosting.IHostingEnvironment'
ım add Rotative folder in wwwroot and added
wkhtmltoimage.exe, wkhtmltopdf.exe
my package version Rotativa.aspnetcore v1.1.1
ım using current asp.net core version 3.xx
what is problem any one can be explain me ?
Remove existing Rotativa.AspNetCore from Nuget packages then install the beta version:
Install-Package Rotativa.AspNetCore -Version 1.2.0-beta
This has the overload method in it that also works with IWebHostingEnvironment
After installing configure in Configure method as:
RotativaConfiguration.Setup(env.WebRootPath, "Rotativa");
Im find a solution like this in statup.cs in configure function add env2 and obsolute
[Obsolete]
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, Microsoft.AspNetCore.Hosting.IHostingEnvironment env2)
and change this like
RotativaConfiguration.Setup(env2);
its working now but ıts bad solution if you know better one pls describe it.
Works on versions 3.0 and 3.1
// Rotary configuration
// This is for the rotating to use the files in the Rotating folder
RotativaConfiguration.Setup (env.ContentRootPath, "Rotativa");
install
Install-Package Rotativa.AspNetCore -Version 1.2.0-beta
set Rotativa environment variable to
RotativaConfiguration.Setup(env.WebRootPath, "/usr/bin/");
If you are on Ubuntu 20.10 or 20.04 install wkhtmlpdf.
sudo apt install wkhtmlpdf
This works for Dot Net Core 3.1 or 5.0 I have tested both.

Plone ZMySQLDA, Couldn't install MySQL-python 1.2.4c1 with buildout

I want to use mysql form ploneformgen, but I
Can't buildout plone.
buildout log http://pastie.org/5345272.js
Getting required 'MySQL-python>=1.2.1'
required by Products.ZMySQLDA 3.1.1.
We have no distributions for MySQL-python that satisfies 'MySQL-python>=1.2.1'.
Getting distribution for 'MySQL-python>=1.2.1'.
Running easy_install:
/usr/local/Plone/Python-2.6/bin/python "-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" "/usr/local/Plone/zeocluster/../buildout-cache/eggs/tmpDSODu0" "-Z" "/usr/local/Plone/buildout-cache/downloads/dist/MySQL-python-1.2.4c1.zip"
path=/usr/local/Plone/buildout-cache/eggs/distribute-0.6.21-py2.6.egg
Processing MySQL-python-1.2.4c1.zip
Running MySQL-python-1.2.4c1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-gFbWLf/MySQL-python-1.2.4c1/egg-dist-tmp-16g1TE
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.19 (/usr/local/Plone/Python-2.6/lib/python2.6/site-packages/distribute-0.6.19-py2.6.egg))
error: Setup script exited with 2
An error occured when trying to install MySQL-python 1.2.4c1. Look above this message for any errors that were output by easy_install.
While:
Installing client1.
Getting distribution for 'MySQL-python>=1.2.1'.
Error: Couldn't install: MySQL-python 1.2.4c1
*************** PICKED VERSIONS ****************
[versions]
Products.PloneFormGen = 1.7.1
Products.ZMySQLDA = 3.1.1
collective.classifieds = 1.6
plone.app.ldap = 1.2.8
quintagroup.dropdownmenu = 1.2.5
quintagroup.pfg.captcha = 1.0.5
zettwerk.ui = 1.1.1
buildout conf http://pastie.org/5345300
some links:
http://blog.mysqlboy.com/2010/08/installing-mysqldb-python-module.html
http://plone.293351.n2.nabble.com/Plone-amp-MySQL-No-quot-Z-MYSQL-Database-Connection-quot-from-ZMI-td5487160.html
It appears the MySQLdb egg requires a newer version of distribute:
The required version of distribute (>=0.6.28) is not available,
and
(Currently using distribute 0.6.19 (/usr/local/Plone/Python-2.6/lib/python2.6/site-packages/distribute-0.6.19-py2.6.egg))
Upgrade your distribute egg first; if you are using the unified installer, for example, versions.cfg pins the version. If so, edit versions.cfg to correct the version number there:
[versions]
...
# Buildout infrastructure
...
distribute = 0.6.28
While you have a perfectly good answer for the specific problem, I highly recommend forgetting about ZMySQLDA and use SQLAlchemyDA which gives you access to any database supported by SQLAlchemy (I've used all of MySQL, PostGreSQL, Oracle, SQLServer) with a single product, and is better supported.

Buildout and p4a.video errors

I'm working on an old version of Plone (buildout for Plone 3.3.6, coming from Plone 3.1).
It includes a custom product which relies on p4a.videoembed and a few other p4a related products. When I run 'bin/buildout' I get the following error:
Installing instance1.
While:
Installing instance1.
Error: There is a version conflict.
We already have: p4a.video 1.3
but p4a.plonevideoembed 1.3 requires 'p4a.video>1.3'.
I checked there is no p4a.video > 1.3 in pypi so, of course it won't retrieve for a higher version of p4a.video.
The solution was to pin p4a.plonevideoembed to an older version. I added a [versions] section to my buildout and "pinned" p4a.plonevideoembed to an older version.
[versions]
p4a.plonevideoembed = 1.1

error installing blitz++

I need blitz++ to run a 3rd party library, but I'm not being able to compile it. The ./configure command runs well and sets the Makefile, but when i make it produces the following error:
In file included from ../blitz/array/funcs.h:29:0,
from ../blitz/array/newet.h:29,
from ../blitz/array/et.h:27,
from ../blitz/array-impl.h:2515,
from ../blitz/array.h:32,
from ../src/globals.cpp:13:
../blitz/funcs.h: In static member function 'static blitz::Fn_abs<long int>::T_numtype blitz::Fn_abs<long int>::apply(blitz::Fn_abs<long int>::T_numtype1)':
../blitz/funcs.h:530:14: error: 'labs' is not a member of 'std'
../blitz/funcs.h:530:14: note: suggested alternative:
/usr/include/stdlib.h:772:17: note: 'labs'
make[1]: *** [globals.lo] Error 1
I followed the instructions and I can't figure why is this happening. I'm using Ubuntu 11.10 and blitz 0.9. Also, I tried with both gcc 4.4 and 4.6. Please help a noob on a workaround.
Blitz++ version 0.9 is seriously outdated. You will need to fetch the code in the source repository:
hg clone http://blitz.hg.sourceforge.net:8000/hgroot/blitz/blitz

Resources