cabal install djinn-lib with GHC 8.4? - ghc

I'm trying to install djinn-lib with GHC 8.4.1 (from Ubuntu 16.04 apt-get).
$ cabal install djinn-lib
But I get an error about ambiguity in the <> operator as shown at the bottom.
Does anyone know how to go about fixing it?
The cabal version I used was:
$ cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.0 of the Cabal library
The error message is:
$ cabal install djinn-lib
Resolving dependencies...
Configuring djinn-lib-0.0.1.2...
Preprocessing library for djinn-lib-0.0.1.2..
Building library for djinn-lib-0.0.1.2..
[1 of 4] Compiling Djinn.LJTFormula ( src/Djinn/LJTFormula.hs, dist/build/Djinn/LJTFormula.o )
[2 of 4] Compiling Djinn.LJT ( src/Djinn/LJT.hs, dist/build/Djinn/LJT.o )
[3 of 4] Compiling Djinn.HTypes ( src/Djinn/HTypes.hs, dist/build/Djinn/HTypes.o )
src/Djinn/HTypes.hs:242:29: error:
Ambiguous occurrence ‘<>’
It could refer to either ‘Prelude.<>’,
imported from ‘Prelude’ at src/Djinn/HTypes.hs:5:8-19
(and originally defined in ‘GHC.Base’)
or ‘Text.PrettyPrint.HughesPJ.<>’,
imported from ‘Text.PrettyPrint.HughesPJ’ at src/Djinn/HTypes.hs:36:67-70
|
242 | ppPat _ (HPAt s p) = text s <> text "#" <> ppPat 10 p
| ^^
src/Djinn/HTypes.hs:242:41: error:
Ambiguous occurrence ‘<>’
It could refer to either ‘Prelude.<>’,
imported from ‘Prelude’ at src/Djinn/HTypes.hs:5:8-19
(and originally defined in ‘GHC.Base’)
or ‘Text.PrettyPrint.HughesPJ.<>’,
imported from ‘Text.PrettyPrint.HughesPJ’ at src/Djinn/HTypes.hs:36:67-70
|
242 | ppPat _ (HPAt s p) = text s <> text "#" <> ppPat 10 p
| ^^
Failed to install djinn-lib-0.0.1.2
cabal: Error: some packages failed to install:
djinn-lib-0.0.1.2-72XYG7inpNR6A7gk4acAK4 failed during the building phase. The
exception was:
ExitFailure 1

The identifier <> was added to the prelude and it clashes with the existing one from HughesPJ. You can add the line import Prelude hiding((<>>)) to the imports section of the files in question to fix this...

Related

cuxfilter.dashboard.DashBoard.preview keeps throwing "NameError: name 'launch' is not defined" at me

TLDR:
await d.preview() # throws "NameError: name 'launch' is not defined"
# d.preview() # does not throw "NameError: name 'launch' is not defined"; however, it still does not produce the desired image in a jupyter notebook... It's __repr__ prints <coroutine object DashBoard.preview at 0x7f44013aaa70>`
I'm trying to preview a rapids dashboard that is correctly rendering in a separate browser window. However, when I try to preview a rasterized screengrab of the dashboard using the convenient looking plotly method, d.preview(), I keep getting this paradoxical exception, "NameError: name 'launch' is not defined".
await d.preview() works in the documentation here:
https://docs.rapids.ai/api/cuxfilter/stable/themes/Themes.html
I am running rapids21.08 in python3.7 on ubuntu (Pop!_OS 20.10) using an RTX2080 GPU using a jupyter notebook with the default jupyter theme made using $ jt -r, and I am not using any matplotlib funny business. I have run the very common import matplotlib.pyplot as plt command.
This seems like a really common problem which I'm surprised isn't just working... Maybe there's something obvious I'm just missing... Please help me!
The full exception can be found postscript.
Thank you for your time,
Tim
P.S.
# d = some cuxfilter.dashboard.DashBoard instance that apparently works with d.show()
await d.preview() # throws NameError: name 'launch' is not defined
throws
NameError: name 'launch' is not defined
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/tmp/ipykernel_8654/2723113380.py in async-def-wrapper()
~/anaconda3/envs/pyenv_ub/lib/python3.7/site-packages/cuxfilter/dashboard.py in preview(self)
507 port=port, websocket_origin=url, show=False, start=True
508 )
--> 509 await screengrab("http://" + url)
510 self.stop()
511
~/anaconda3/envs/pyenv_ub/lib/python3.7/site-packages/cuxfilter/assets/screengrab.py in screengrab(url)
6
7 async def screengrab(url):
----> 8 browser = await launch({"slowMo": 5}, args=["--no-sandbox"])
9 page = await browser.newPage()
10 await page.setViewport(
NameError: name 'launch' is not defined
This is probably due to the missing pyppeteer package. Installing this in the conda env should resolve the issue:
conda install -c conda-forge pyppeteer>=0.2.6
cuxfilter=21.10 won't have this issue, as the dependency has been added to it.

Lots of broken haskell packages

(Arch linux) I have been having a lot of problems lately with haskell packages. Normally I would fix them fairly easily by updating some packages, but there is probably a root cause to all of them that I cannot figure out. I currently think the most likely explanation is that I went wrong somewhere in the haskell installation process, as I did not use the “haskell platform” but somewhat haphazardly installed packages from all over the place when I needed them. I just performed a system upgrade, and now when I run startx, this is the result. The shared object file it references near the end, libHSxmonad-contrib-0.16-AAxGT3H9yrS67i4YFgpjoh-ghc8.10.1.so, does not in fact exist, but two libHSxmonad-contrib shared object files that end in ghc8.0.2 (which is my ghc —-version) do exist. Also, most of the packages it says are missing I remember installing (some via cabal, some pacman) at some point or another. If it helps, here is my cabal list —-installed, ghc-pkg check, and pacman -Q|grep haskell.
[Arch Linux] I am not sure if this is related, but recently I've been increasingly annoyed by the recurrent frequency of interminable Haskell package updates -- in my case virtually solely triggered by my pandoc installation.
Resolution
yay -Syu ## system update; alt: sudo -Syu
sudo pacman -R pandoc ## uninstall pandoc
## ----------------------------------------
## Repeated cycles (~5-6) of the following, until nothing shown:
sudo pacman -Qdt ## list all packages no longer required
## as dependencies (orphans) ...
sudo pacman -R $(pacman -Qdtq) ## ... and delete them
## ----------------------------------------
yay -Syu ## system update; alt: sudo -Syu
Update. For clarity, run as many cycles as needed of:
sudo pacman -R $(pacman -Qdtq)
To find dependencies , use pactree :
[victoria#victoria ~]$ pactree -h
pactree v1.8.2
Package dependency tree viewer.
Usage: pactree [options] <package>
Options:
-a, --ascii use ASCII characters for tree formatting
-c, --color colorize output
--config <path> set an alternate configuration file
-b, --dbpath <path> set an alternate database location
--debug display debug messages
-d, --depth <#> limit the depth of recursion
--gpgdir <path> set an alternate home directory for GnuPG
-g, --graph generate output for graphviz's dot
-l, --linear enable linear output
-o, --optional[=depth] controls at which depth to stop printing optional deps
(-1 for no limit)
-r, --reverse list packages that depend on the named package
-s, --sync search sync databases instead of local
-u, --unique show dependencies with no duplicates (implies -l)
-h, --help display this help message and exit
-V, --version display version information and exit
[victoria#victoria ~]$ pactree -r haskell
error: package 'haskell' not found ## removed per this discussion
[victoria#victoria ~]$ pactree -r vim
gvim provides vim ## I installed Vim via gVim to get the clipboard
[victoria#victoria ~]$
Sample output
[victoria#victoria 2.0]$ sudo pacman -R $(pacman -Qdtq)
checking dependencies...
Packages (88) asar-3.0.3-1 crypto++-8.2.0-3 dep-0.5.4-5 devilspie-0.23-4 extra-cmake-modules-5.77.0-1 fuseiso-20070708-8 gendesk-1.0.6-1 giblib-1.2.4-8 gnome-common-3.18.0-4 go-2:1.15.6-1 go-bindata-3.5.2-2
gobject-introspection-1.66.1-3 gperf-3.1-3 haskell-bitarray-0.0.1.1-19 haskell-citeproc-0.2-9 haskell-cmark-gfm-0.2.2-20 haskell-commonmark-pandoc-0.2.0.1-36 haskell-doctemplates-0.8.3-10 haskell-glob-0.10.1-33
haskell-haddock-library-1.9.0-65 haskell-hslua-module-system-0.2.2.1-22 haskell-hslua-module-text-0.3.0.1-10 haskell-http-4000.3.15-57 haskell-http-client-tls-0.3.5.3-344 haskell-ipynb-0.1.0.1-128
haskell-jira-wiki-markup-1.3.2-32 haskell-juicypixels-3.3.5-42 haskell-regex-pcre-0.95.0.0-7 haskell-sha-1.6.4.4-15 haskell-skylighting-0.10.0.2-4 haskell-tagsoup-0.14.8-67 haskell-texmath-0.12.0.3-48
haskell-unicode-transforms-0.3.7.1-16 haskell-zip-archive-0.4.1-71 ibus-1.5.23+3+gaa558de8-2 ipython2-5.9.0-1 jq-1.6-4 js68-68.12.0-1 kitty-terminfo-0.19.3-1 libgpod-0.8.3-11 libguess-1.2-3
libhandy0-0.0.13+12+gaa6b6f4-2 libkcddb-20.12.0-1 libkeybinder2-0.3.1-4 liblastfm-qt5-1.0.9-5 libmspack-1:0.10.1alpha-3 libmygpo-qt5-1.1.0-3 liborcus-0.16.1-5 libpqxx-6.4.5-2 libspf2-1.2.10-5 lsb-release-1.4-18
lv2-1.18.0-1 mathjax2-2.7.9-1 perl-number-bytes-human-0.11-4 perl-test-needs-0.002006-3 perl-test-pod-1.52-5 pygtk-2.24.0-12 python-atomicwrites-1.4.0-3 python-click-log-0.3.2-7 python-configobj-5.0.6-10
python-flask-babel-2.0.0-3 python-icalendar-4.0.7-3 python-pipenv-2020.11.15-1 python-pytoml-0.1.21-6 python-tensorflow-serving-api-2.3.0-2 python-tzlocal-2.1-3 python-urwid-2.1.1-3 python-yaml-5.3.1-4
python2-apsw-3.33.0-3 python2-dateutil-2.8.1-5 python2-dbus-1.2.16-3 python2-feedparser-5.2.1-9 python2-ipaddress-1.0.23-2 python2-msgpack-0.6.2-4 python2-mutagen-1.43.0-3 python2-pillow-6.2.1-3
python2-psutil-5.7.3-3 python2-simplejson-3.17.2-3 quilt-0.66-2 sndio-1.7.0-3 tesseract-4.1.1-4 uwsgi-plugin-python-2.0.19.1-7 wxgtk2-3.0.5.1-1 xorg-bdftopcf-1.1-2 xorg-font-util-1.3.2-2 xorg-mkfontscale-1.2.1-2
xorg-server-xvfb-1.20.10-3 yasm-1.3.0-4
Total Removed Size: 867.02 MiB
:: Do you want to remove these packages? [Y/n] y
...
## ***************************
## ** Subsequent cycles: ***
## ***************************
Packages (47) autoconf-archive-1:2019.01.06-4 cmake-3.19.2-1 cmark-gfm-0.29.0.gfm.0-2 diffstat-1.63-1 gtk-doc-1.33.1-1 haskell-aeson-pretty-0.8.8-101 haskell-commonmark-extensions-0.2.0.4-6 haskell-connection-0.3.1-72
haskell-data-default-0.7.1.1-92 haskell-digest-0.0.1.2-21 haskell-doclayout-0.3-50 haskell-file-embed-0.0.13.0-2 haskell-hslua-1.3.0-7 haskell-hsyaml-0.2.1.0-57 haskell-http-client-0.7.3-22
haskell-old-time-1.1.0.3-26 haskell-pandoc-types-1.22-20 haskell-regex-base-0.94.0.0-7 haskell-skylighting-core-0.10.0.2-4 haskell-temporary-1.3-145 haskell-text-conversions-0.3.1-22 haskell-text-icu-0.7.0.1-36
haskell-uniplate-1.6.13-9 haskell-xml-1.3.14-26 haskell-xml-conduit-1.9.0.0-82 intltool-0.51.0-6 leptonica-1.80.0-1 libixion-0.16.1-5 libmusicbrainz5-5.1.0-4 python-certifi-2020.6.20-3 python-flask-1.1.2-4
python-greenlet-0.4.17-3 python-mako-1.1.3-3 python-speaklater-1.3-9 python-virtualenv-20.2.2-1 python-virtualenv-clone-0.5.4-3 python2-backports.shutil_get_terminal_size-1.0.0-4 python2-cairo-1.18.2-4
python2-gobject2-2.28.7-6 python2-numpy-1.16.6-1 python2-olefile-0.46-3 python2-pexpect-4.8.0-3 python2-pickleshare-0.7.5-5 python2-prompt_toolkit1-1.0.15-2 python2-traitlets-4.3.3-6 sg3_utils-1.45-1
yelp-tools-3.38.0-1
Packages (41) glib2-docs-2.66.4-1 haskell-aeson-1.5.4.1-26 haskell-ansi-terminal-0.11-25 haskell-base16-bytestring-1.0.1.0-1 haskell-base64-bytestring-1.2.0.1-8 haskell-blaze-html-0.9.1.2-62 haskell-cmdargs-0.10.20-15
haskell-commonmark-0.1.1.2-7 haskell-conduit-extra-1.3.5-75 haskell-cookie-0.4.5-8 haskell-data-default-instances-containers-0.0.1-32 haskell-data-default-instances-dlist-0.0.1-105
haskell-data-default-instances-old-locale-0.0.1-32 haskell-emojis-0.1-52 haskell-errors-2.3.0-58 haskell-http-types-0.12.3-105 haskell-hxt-9.3.1.18-185 haskell-mime-types-0.1.0.9-10 haskell-quickcheck-2.14.2-24
haskell-socks-0.6.1-64 haskell-syb-0.7.1-8 haskell-tls-1.5.4-52 haskell-utf8-string-1.0.1.1-20 haskell-x509-system-1.6.6-164 haskell-xml-types-0.3.8-4 itstool-1:2.0.6-2 jsoncpp-1.9.4-1 mallard-ducktype-1.0.2-6
python-anytree-2.8.0-3 python-beaker-1.11.0-6 python-filelock-3.0.12-5 python-itsdangerous-1.1.0-6 python-jinja-2.11.2-4 python2-decorator-4.4.2-3 python2-enum34-1.1.9-1 python2-pathlib-1.0.1-5
python2-ptyprocess-0.6.0-6 python2-pygments-2.5.2-2 python2-wcwidth-0.2.5-3 rhash-1.4.0-1 yelp-xsl-3.38.2-1
Packages (23) haskell-attoparsec-0.13.2.4-41 haskell-base-compat-batteries-0.11.2-18 haskell-blaze-markup-0.8.2.7-32 haskell-case-insensitive-1.2.1.0-44 haskell-cereal-0.5.8.1-8 haskell-colour-2.3.5-83 haskell-conduit-1.3.4-8
haskell-data-fix-0.3.0-32 haskell-dlist-1.0-28 haskell-erf-2.0.0.0-20 haskell-hxt-regex-xmlschema-9.2.0.3-24 haskell-hxt-unicode-9.0.2.4-20 haskell-network-uri-2.6.3.0-204 haskell-old-locale-1.0.0.7-26
haskell-safe-0.3.19-4 haskell-streaming-commons-0.2.2.1-33 haskell-strict-0.4.0.1-6 haskell-time-compat-1.9.5-6 haskell-typed-process-0.2.6.0-68 haskell-uuid-types-1.0.3-63 haskell-x509-validation-1.6.11-96
python-babel-2.9.0-1 python-markupsafe-1.1.1-6
Packages (14) haskell-async-2.2.2-48 haskell-base-compat-0.11.2-3 haskell-blaze-builder-0.4.1.0-15 haskell-byteable-0.1.1-21 haskell-data-default-class-0.1.2.0-20 haskell-hxt-charproperties-9.4.0.0-8
haskell-mono-traversable-1.0.15.1-79 haskell-network-3.1.2.1-6 haskell-random-1.2.0-68 haskell-resourcet-1.2.4.2-36 haskell-scientific-0.3.6.2-58 haskell-these-1.1.1.1-33 haskell-x509-store-1.6.7-96
haskell-zlib-0.6.2.2-4
Packages (8) haskell-assoc-1.0.2-32 haskell-integer-logarithms-1.0.3.1-2 haskell-split-0.2.3.4-86 haskell-splitmix-0.1.0.3-13 haskell-unliftio-core-0.2.0.1-5 haskell-unordered-containers-0.2.13.0-16
haskell-vector-algorithms-0.8.0.4-6 haskell-x509-1.7.5-97
Packages (6) haskell-asn1-parse-0.9.5-63 haskell-bifunctors-5.5.8-22 haskell-cryptonite-0.27-37 haskell-hashable-1.3.0.0-44 haskell-pem-0.2.4-119 haskell-vector-0.12.1.2-76
Packages (3) haskell-asn1-types-0.3.4-42 haskell-distributive-0.6.2-48 haskell-transformers-compat-0.6.6-2
Packages (4) haskell-base-orphans-0.8.4-8 haskell-hourglass-0.2.12-87 haskell-memory-0.15.0-54 haskell-tagged-0.8.6-13
Packages (1) haskell-basement-0.0.11-9

R CRAN Check: autoheader: warning: missing template: HAVE_GSL_HEADER autoheader: Use AC_DEFINE([HAVE_GSL_HEADER], [], [Description])

Recently a package on CRAN that I am maintaining gets the following error:
(I did not change anything - error just was not present before - CRAN probably added additional checks)
Result: WARN
Output from running autoreconf:
autoheader: warning: missing template: HAVE_GSL_HEADER
autoheader: Use AC_DEFINE([HAVE_GSL_HEADER], [], [Description])
autoreconf: /usr/bin/autoheader failed with exit status: 1
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc
Here is the link to the CRAN check page:
https://cran.r-project.org/web/checks/check_results_ridge.html
The error seems to appear only for r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc.
Github Link to package Source Code:
https://github.com/SteffenMoritz/ridge
The package uses the GSL lib. (if somebody wonders about the GSL in the error message)
Unfortunately I only overtook maintenance of the package and don't have too much idea about the C things.
I assume, the error message has nothing to do with the R part of the package. Do I have to add the AC_DEFINE somewhere in the C files?
Could somebody explain me, what exactly the error message says to me. Guess this might already help me to figure things out.
edit:
Think I have to change something in this file (just a guess)
https://github.com/SteffenMoritz/ridge/blob/master/configure.ac
But the code there is the following:
if test "${HAVE_GSL}" = TRUE; then
dnl Define HAVE_GSL_H in src/config.h
AC_CHECK_HEADERS([gsl/gsl_version.h],AC_DEFINE(HAVE_GSL_HEADER), [HAVE_GSL=FALSE])
if test "${HAVE_GSL}" = FALSE; then
AC_MSG_WARN([gsl headers not found, perhaps check the path?])
AC_MSG_WARN([ridge will be installed, but some functions will be
unavailable])
fi
fi
So it seems there is a statement AC_DEFINE(HAVE_GSL_HEADER), [HAVE_GSL=FALSE]).
Put the below into a file called diff.patch or whatever you like in the top directory.
diff --git a/configure.ac b/configure.ac
index e643140..0b256a6 100644
--- a/configure.ac
+++ b/configure.ac
## -22,7 +22,8 ## fi
if test "${HAVE_GSL}" = TRUE; then
dnl Define HAVE_GSL_H in src/config.h
- AC_CHECK_HEADERS([gsl/gsl_version.h],AC_DEFINE(HAVE_GSL_HEADER),[HAVE_GSL=FALSE])
+ AC_CHECK_HEADERS([gsl/gsl_version.h],
+ AC_DEFINE(HAVE_GSL_HEADER, [], [Description]),[HAVE_GSL=FALSE])
if test "${HAVE_GSL}" = FALSE; then
AC_MSG_WARN([gsl headers not found, perhaps check the path?])
AC_MSG_WARN([ridge will be installed, but some functions will be unavailable])
Run patch -p1 < diff.patch.
Now autoreconf should rebuild all just fine.

Wrong directory for sipcfg.sip_module_dir

By trying to compile QGIS from sources on Ubuntu, there is the file /opt/QGIS/cmake/FindSIP.py which content is:
import sipconfig
sipcfg = sipconfig.Configuration()
print("sip_version:%06.0x" % sipcfg.sip_version)
print("sip_version_num:%d" % sipcfg.sip_version)
print("sip_version_str:%s" % sipcfg.sip_version_str)
print("sip_bin:%s" % sipcfg.sip_bin)
print("default_sip_dir:%s" % sipcfg.default_sip_dir)
print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
# SIP 4.19.10+ has new sipcfg.sip_module_dir
if hasattr(sipcfg, "sip_module_dir"):
print("sip_module_dir:%s" % sipcfg.sip_module_dir)
else:
print("sip_module_dir:%s" % sipcfg.sip_mod_dir)
In Python3.6, the last if/else statement prints:
sip_module_dir:/usr/lib/python3.6/dist-packages
But the string /usr/lib/python3.6/dist-packages doesn't match an existing directory (it is probably part of why I encountered the error:
python/CMakeFiles/python_module_qgis__core.dir/build.make:537: recipe for target 'python/core/sip_corepart0.cpp' failed' failed during build process).
I either have:
/usr/lib/python3/dist-packages
or
/usr/lib/python3.6/site-packages
And it's only in /usr/lib/python3/dist-packages that I have some 'sip' related files (the other directory gives no results):
$ find . -iname "*sip*"
./twisted/protocols/__pycache__/sip.cpython-36.pyc
./twisted/protocols/sip.py
./twisted/test/test_sip.py
./twisted/test/__pycache__/test_sip.cpython-36.pyc
./sipconfig.py
./sip.pyi
./sipconfig_nd6.py
./sipdistutils.py
./__pycache__/sipconfig_nd6.cpython-36.pyc
./__pycache__/sipdistutils.cpython-36.pyc
./__pycache__/sipconfig.cpython-36.pyc
./sip.cpython-36m-x86_64-linux-gnu.so
I guess there is something to fix within 'sip' itself but don't know where exactly, neither how to do that.
More information;
OS: Ubuntu 16.04 64 bits
Python: 3.6.7
Sip: 4.19.7

IPython notebook and rmagic/rpy2: cannot find module ri2py (OSX 10.8.5, python 2.7, R 3.1)

I'm trying to use the rmagic extension for the IPython notebook, using Python 2.7.6 via Enthought Canopy.
When I try the following example:
import numpy as np
import pylab
X = np.array([0,1,2,3,4])
Y = np.array([3,5,4,6,7])
pylab.scatter(X, Y)
%Rpush X Y
%R lm(Y~X)$coef
I get an error:
AttributeError Traceback (most recent call last)
<ipython-input-7-96dff2c70ba0> in <module>()
1 get_ipython().magic(u'Rpush X Y')
----> 2 get_ipython().magic(u'R lm(Y~X)$coef')
…
/Users/hrob/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/IPython/extensions/rmagic.pyc in eval(self, line)
212 res = ro.r("withVisible({%s})" % line)
213 value = res[0] #value (R object)
--> 214 visible = ro.conversion.ri2py(res[1])[0] #visible (boolean)
215 except (ri.RRuntimeError, ValueError) as exception:
216 warning_or_other_msg = self.flush() # otherwise next return seems to have copy of error
AttributeError: 'module' object has no attribute 'ri2py'
I can't find anyone else who's had the same problem and don't know enough to solve it myself. There is no definition for ri2py in conversion.py though.
I initially had installed Anaconda and was running python notebook through that, with exactly the same results.
rpy2 (version 2.4.0) installed successfully but when I test it I get 1 expected failure as follows:
python -m 'rpy2.robjects.tests.__init__'
…
testNewWithTranslation (testFunction.SignatureTranslatedFunctionTestCase) ... expected failure
I don't know if that's related.
Can anyone suggest what the problem might be and how I might fix it? Are the versions of python, R, etc. that I'm using compatible or do I need to re-install/update something?
Are you using %load_ext rmagic?
If so, try using %load_ext rpy2.ipython instead.
This is one of the new features in version 2.4.0.

Resources