Cannot install Readline with Rakudo Perl 6 zef - raku

I'm trying to install Readline.
(The system is Linux Mint Mate 18.3, the same is true for Lubuntu 17.10).
$ zef install Readline
The installation process begins but later is aborted with the following messages:
===> Searching for: Readline
===> Searching for missing dependencies: LibraryCheck
===> Testing: LibraryCheck:ver<0.0.6>:auth<github:jonathanstowe>
===> Testing [OK] for LibraryCheck:ver<0.0.6>:auth<github:jonathanstowe>
===> Testing: Readline:ver<0.0.2>:auth<github:drforr>
# Failed test 'initialize'
# at t/02-base.t line 10
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'macro-dumper lives'
# at t/02-base.t line 18
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 1 test of 1
# Failed test 'dumpers'
# at t/02-base.t line 13
# Failed test 'set-prompt lives'
# at t/02-base.t line 27
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'expand-prompt lives'
# at t/02-base.t line 29
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'on-new-line-with-prompt lives'
# at t/02-base.t line 31
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'save-prompt lives'
# at t/02-base.t line 33
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'restore-prompt lives'
# at t/02-base.t line 35
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 5 tests of 5
# Failed test 'prompt'
# at t/02-base.t line 24
# Failed test 'tilde-expand lives'
# at t/02-base.t line 46
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'tilde-expand-word lives'
# at t/02-base.t line 48
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 2 tests of 2
# Failed test 'tilde'
# at t/02-base.t line 39
# Failed test 'prep-terminal lives'
# at t/02-base.t line 58
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'deprep-terminal lives'
# at t/02-base.t line 60
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'reset-terminal'
# at t/02-base.t line 62
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 3 tests of 3
# Failed test 'terminal'
# at t/02-base.t line 54
# Failed test 'reset-line-state lives'
# at t/02-base.t line 70
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 1 test of 1
# Failed test 'state'
# at t/02-base.t line 68
# Failed test 'free-undo-list lives'
# at t/02-base.t line 81
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'do-undo lives'
# at t/02-base.t line 83
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'begin-undo-group lives'
# at t/02-base.t line 85
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'end-undo-group lives'
# at t/02-base.t line 87
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 4 tests of 4
# Failed test 'undo'
# at t/02-base.t line 80
# Failed test 'funmap-names lives'
# at t/02-base.t line 99
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 1 test of 1
# Failed test 'funmap'
# at t/02-base.t line 91
# Failed test 'set-screen-size'
# at t/02-base.t line 106
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'reset-screen-size lives'
# at t/02-base.t line 110
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 2 tests of 2
# Failed test 'screen'
# at t/02-base.t line 103
# Failed test 'insert-text lives'
# at t/02-base.t line 118
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'delete-text lives'
# at t/02-base.t line 120
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'kill-text lives'
# at t/02-base.t line 122
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'copy-text lives'
# at t/02-base.t line 124
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Looks like you failed 4 tests of 4
# Failed test 'text'
# at t/02-base.t line 114
# Failed test 'make-bare-keymap lives'
# at t/02-base.t line 132
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'copy-keymap lives'
# at t/02-base.t line 134
# Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
# Failed test 'make-keymap lives'
# at t/02-base.t line 136
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'discard-keymap lives'
# at t/02-base.t line 138
# Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
# Failed test 'get-keymap-by-name lives'
# at t/02-base.t line 145
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'get-keymap lives'
# at t/02-base.t line 147
# Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
# Failed test 'get-keymap-name lives'
# at t/02-base.t line 149
# Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
# Failed test 'set-keymap lives'
# at t/02-base.t line 151
# Type check failed in binding to parameter '$map'; expected Readline::Keymap but got Any (Any)
# Looks like you failed 8 tests of 8
# Failed test 'keymap'
# at t/02-base.t line 128
Cannot locate native library 'libreadline.so': libreadline.so: cannot open shared object file: No such file or directory
in method setup at /opt/rakudo-pkg/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 289
in method CALL-ME at /opt/rakudo-pkg/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 576
in method make-bare-keymap at /home/evb/.zef/store/perl6-readline.git/e2cf431a87c36d420a3f2737b2cbc160efeb9233/lib/Readline.pm (Readline) line 1040
in sub at t/02-base.t line 162
in sub subtest at /opt/rakudo-pkg/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 411
in sub at t/02-base.t line 161
in sub subtest at /opt/rakudo-pkg/share/perl6/sources/C712FE6969F786C9380D643DF17E85D06868219E (Test) line 411
in block <unit> at t/02-base.t line 155
===> Testing [FAIL]: Readline:ver<0.0.2>:auth<github:drforr>
Aborting due to test failure: Readline:ver<0.0.2>:auth<github:drforr> (use --force-test to override)
in code at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 375
in method test at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 353
in code at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 530
in sub at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 527
in method install at /home/evb/.perl6/sources/0061125F96D1E60B6E3B0001A4CB4D4188DF4869 (Zef::Client) line 633
in sub MAIN at /home/evb/.perl6/sources/C360CEB3AF792C33F65155FA82FDB7AB4467EC82 (Zef::CLI) line 152
in block <unit> at bin/zef line 3
locate libreadline.so gives the following output:
/lib/x86_64-linux-gnu/libreadline.so.5
/lib/x86_64-linux-gnu/libreadline.so.5.2
/lib/x86_64-linux-gnu/libreadline.so.6
/lib/x86_64-linux-gnu/libreadline.so.6.3

Many distributions, including debian/ubuntu and friends encourage a certain separation between packaging, more information in the debian.org packaging docs.
In particular, they encourage distribution of shared libraries for certain versions (such as .so.1) that are dependencies of other packages separate from the 'unversioned' .so that are more typically used for 'development' (in distribution packages ending in -dev).
From the above docs:
Please note that the development package should contain a symlink for the associated shared library without a version number. E.g.: /usr/lib/x86_64-linux-gnu/libfoo.so -> libfoo.so.1
For readline, that link is in the libreadline-dev package, which can be installed on mint/ubuntu/debian type systems like this: sudo apt-get install libreadline-dev
Perl 6 NativeCall docs discuss this too:
If you write native('foo') NativeCall will search libfoo.so under Unix
like system (libfoo.dynlib on OS X, foo.dll on win32). In most modern
system it will require you or the user of your module to install the
development package because it's recommended to always provide an
API/ABI version to a shared library, so libfoo.so ends often being a
symbolic link provided only by a development package.
To avoid that, the native trait allows you to specify the API/ABI
version. It can be a full version or just a part of it. (Try to stick
to Major version, some BSD code does not care for Minor.)
It looks like Readline does not specify a specific API/ABI version. (perhaps it should?)
Since it does not, it will look for the unversioned shared library (plain .so).

See this perl6-readline issue.
Until #drforr has time to sort out the versions, I created a temporarely fork that installs fine on Ubuntu 18.04 and all the distributions using libreadline version 7.
To install the module:
$ zef install https://github.com/nxadm/perl6-readline.git
If you want to patch the issue yourself (1 line patch), you can follow the instructions in my comment on a related issue.

Related

Accessing agent computer in azure devops

I am new in azure devops services, and i am trying to run a pipeline that process an asp.net core application.
I have a task for restoring the project dependencies. Its code is dotnet Restore
.
The piepeline fail on that command with this message :
1:5>C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [D:\a\1\s\AspNetProjectOnDocker.csproj]
Done executing task "NETSdkError" -- FAILED.
1:5>Done building target "_CheckForUnsupportedNETCoreVersion" in project "AspNetProjectOnDocker.csproj" -- FAILED.
1:5>Done Building Project "D:\a\1\s\AspNetProjectOnDocker.csproj" (_GenerateRestoreGraphProjectEntry target(s)) -- FAILED.
1>Done executing task "MSBuild" -- FAILED.
1>Done building target "_GenerateRestoreGraph" in project "AspNetProjectOnDocker.csproj" -- FAILED.
1>Done Building Project "D:\a\1\s\AspNetProjectOnDocker.csproj" (Restore target(s)) -- FAILED.
AspNetProjectOnDocker is the name of my .net project
My Questions :
How to access to the folder : C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets specified in the error message above.
Thanks.
My Questions :
How to access to the folder : C:\Program
Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets
specified in the error message above.
Answer to your question:
This is not a folder, it is a file. You can access it via the following YAML pipeline definition.
trigger:
- none
pool:
vmImage: windows-2019
steps:
- script: |
echo Check target file
C:
cd C:\Program Files\dotnet\sdk\5.0.410\Sdks\Microsoft.NET.Sdk\targets
more Microsoft.NET.TargetFrameworkInference.targets
displayName: 'Check target file'
# if you encounter some issue such as can't find directory, you can use the following method to check what happens.
# - script: |
# echo Check target file step by step
# dir
# C:
# dir
# cd Program Files
# dir
# cd dotnet
# dir
# cd sdk
# dir
# cd 5.0.410
# dir
# cd Sdks
# dir
# cd Microsoft.NET.Sdk
# dir
# cd targets
# dir
# more Microsoft.NET.TargetFrameworkInference.targets
# displayName: 'Check target file step by step'
Successfully get the file content:

Cannot install kernel-devsrc

I'm trying to set up my environment to use Yocto's generated SDK to compile my out-of-tree module, but for some reason, I'm getting an error.
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
I'm using Poky distribution and meta-raspberrypi which is needed because I'm using the RPI ZeroW board.
Apart from this everything works fine. I'm able to compile the entire image and load it on the board.
Here is the line I've added to local.conf
TOOLCHAIN_TARGET_TASK_append = " kernel-devsrc"
as I've found in the documentation.
Also below you can find the whole log from the compilation.
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-bsp/u-boot/u-boot-tools_2020.07.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/binutils/binutils-cross_2.35.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kmod/kmod-native_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-cross_10.2.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-support/gmp/gmp_6.2.0.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/xz/xz_5.2.5.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-connectivity/openssl/openssl_1.1.1k.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/bison/bison_3.7.2.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.66.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-extended/bc/bc_1.07.1.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-core/glibc/glibc_2.32.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb:do_populate_sysroot', 'virtual:native:/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', '/home/pp/yocto-hh/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_10.2.bb:do_populate_sysroot']
NOTE: Installed into sysroot: []
NOTE: Skipping as already exists in sysroot: ['u-boot-tools-native', 'binutils-cross-arm', 'kmod-native', 'gcc-cross-arm', 'gmp-native', 'pkgconfig-native', 'xz-native', 'openssl-native', 'bison-native', 'quilt-native', 'bc-native', 'glibc', 'patch-native', 'kern-tools-native', 'pseudo-native', 'gcc-runtime', 'python3-native', 'gnu-config-native', 'autoconf-native', 'libtool-native', 'gtk-doc-native', 'automake-native', 'zlib-native', 'texinfo-dummy-native', 'readline-native', 'flex-native', 'attr-native', 'libmpc-native', 'mpfr-native', 'linux-libc-headers', 'gettext-minimal-native', 'libgcc', 'libnsl2-native', 'gdbm-native', 'libffi-native', 'bzip2-native', 'util-linux-native', 'sqlite3-native', 'libtirpc-native', 'm4-native', 'ncurses-native', 'libcap-ng-native', 'libpcre2-native']
DEBUG: Python function extend_recipe_sysroot finished
DEBUG: Executing shell function do_install
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command.
ERROR: Execution of '/home/pp/yocto-hh/build/tmp/work/hhctrl-poky-linux-gnueabi/kernel-devsrc/1.0-r0/temp/run.do_install.109942' failed with exit code 1:
cp: cannot stat 'arch/arm/kernel/module.lds': No such file or directory
WARNING: exit code 1 from a shell command
The command I am using to produce the SDK is:
bitbake name-of-my-image -c populate_sdk
What could be the problem here? Or how should I debug it? I've found a few touching on the subject and it seems that it should be already fixed, but for some reason, in my environment, it still does not work.
Missing the module.lds file in the latest kernel. Apply the following source code as a patch in the kernel and build the image.
diff -Naur a/arch/arm/kernel/module.lds b/arch/arm/kernel/module.lds
--- a/arch/arm/kernel/module.lds 1970-01-01 05:30:00.000000000 +0530
+++ b/arch/arm/kernel/module.lds 2020-02-28 21:53:45.000000000 +0530
## -0,0 +1,5 ##
+/* SPDX-License-Identifier: GPL-2.0 */
+SECTIONS {
+ .plt : { BYTE(0) }
+ .init.plt : { BYTE(0) }
+}

Buildroot - installing of the "pytest-runner" package fails

Buildroot version: 2017-02
I need to integrate python package 'chardet' to my build. The chardet require the 'pytest-runner'package.
Case 1
The 'chardet' is marked to be integrated into build. The 'pytest-runner' is not pre-feteched and the 'chardet' package updated to the latest version (3.0.3) before the build with the scanpypi script. When the make is run the following error message is shown indicating problems with the 'pytest-runner':
>>> python-chardet 3.0.3 Building
(cd /home/nnnn/bldr_lab/buildroot/output/build/python-chardet-3.0.3//;
PATH="/home/nnnn/bldr_lab/buildroot/output/host/bin:/home/nnnn/bldr_lab
/buildroot/output/host/sbin:/home/nnnn/bldr_lab/buildroot/output/host/usr
/bin:/home/nnnn/bldr_lab/buildroot/output/host/usr/sbin:/home/nnnn/x-tools
/arm-cortex_a8-linux-gnueabihf/bin:/home/nnnn/bin:/home/nnnn/.local
/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr
/games:/usr/local/games" PYTHONPATH="/home/nnnn/bldr_lab/buildroot/output
/target/usr/lib/python2.7/sysconfigdata/:/home/nnnn/bldr_lab/buildroot
/output/target/usr/lib/python2.7/site-packages/" _python_sysroot=/home
/nnnn/bldr_lab/buildroot/output/host/usr/arm-buildroot-linux-gnueabihf
/sysroot _python_prefix=/usr _python_exec_prefix=/usr /home/nnnn/bldr_lab
/buildroot/output/host/usr/bin/python setup.py build )
Download error on https://pypi.python.org/simple/pytest-runner/: unknown
url type: https -- Some packages may not be found!
Couldn't find index page for 'pytest-runner' (maybe misspelled?)
Download error on https://pypi.python.org/simple/: unknown url type: https
-- Some packages may not be found!
No local packages or download links found for pytest-runner
Traceback (most recent call last):
File "setup.py", line 52, in <module>
['chardetect = chardet.cli.chardetect:main']})
File "/home/nnnn/bldr_lab/buildroot/output/host/usr/lib/python2.7
/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 268, in
__init__
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 313, in
fetch_build_eggs
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 846, in resolve
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1091, in best_match
File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 1103, in obtain
File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 380, in fetch_build_egg
File "build/bdist.linux-x86_64/egg/setuptools/command/easy_install.py", line 633, in easy_install
distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pytest-runner')
package/pkg-generic.mk:216: recipe for target '/home/nnnn/bldr_lab
/buildroot/output/build/python-chardet-3.0.3/.stamp_built' failed
make[1]: *** [/home/nnnn/bldr_lab/buildroot/output/build/python-chardet-
3.0.3/.stamp_built] Error 1
Makefile:79: recipe for target '_all' failed
make: *** [_all] Error 2
case 2 When I try to create the 'pytest-runner' with the scanpypi the following error message is shown:
nnnn#xxxx:~/bldr2/buildroot$ ./support/scripts/scanpypi pytest-runner -o package
buildroot package name for pytest-runner: python-pytest-runner
Package: python-pytest-runner
Fetching package pytest-runner
Downloading package pytest-runner from https://pypi.python.org/packages/9e/4d/08889e5e27a9f5d6096b9ad257f4dea1faabb03c5ded8f665ead448f5d8a/pytest-runner-2.11.1.tar.gz...
Error: Could not install package pytest-runner
When I download the 'pytest-runner-2.11.1.tar.gz' from pypi manually it looks as normal pypi tar file. Any idea what is root cause and how to solve the problem?
-timo-

CX_FREEEZE, INNO : could not find the matplotlib data files

I made an executable file from python scripts and cx_freeze. The freezing looks ok. But I have problmes when I use INNO to create a setup file. I can create the setup and successfully deploy the application. But while I launch it from "Program Files (x86)" directory I have a runtime error : Could not find the matplotlib data files
C:\Program Files (x86)\GLADDataExtraction>main
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec(code, m.__dict__)
File "main.py", line 8, in <module>
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 947, in <module>
rcParams = rc_params()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 865, in rc_params
return rc_params_from_file(fname, fail_on_error)
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 930, in rc_params_from_file
ret['datapath'] = get_data_path()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 312, in wrapper
ret = func(*args, **kwargs)
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 655, in _get_data_path_cached
defaultParams['datapath'][0] = _get_data_path()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 651, in _get_data_path
raise RuntimeError('Could not find the matplotlib data files')
RuntimeError: Could not find the matplotlib data files
I looked for explanations on internet quite extensively without success. There are many topics linked to py2exe but none for cx_freeze.
I investigated my cx_freeze setup.py file, displayed below :
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python 2.7
# 02/2011
import sys, os
from cx_Freeze import setup, Executable
import matplotlib
#############################################################################
# préparation des options
# chemins de recherche des modules
path='D:\\IceSat\\tests\\test_executable\\test_GLASDataExtraction'
if os.path.exists(path):
print "exist"
if path in sys.path:
print "OK"
else:
print "insert"
sys.path.append(path)
path = sys.path + ["package_interface", "package_traitement"]
##build_exe_options = { 'packages': ['scipy'],
## "include_files": [('C:\\Python27\\Lib\\site-packages\\scipy\\special\\_ufuncs.pyd','_ufuncs.pyd')]}
# options d'inclusion/exclusion des modules
##includes = ["sip", "matplotlib"]
includes = ["sip"]
##excludes = ["tk","tcl"]
excludes = []
##packages = ["scipy", "scipy.signal", "scipy.special", "matplotlib", "matplotlib.mpl-data"]
##packages = ["scipy", "scipy.signal", "scipy.special", "matplotlib", "matplotlib.backends"]
##packages = ["scipy", "scipy.signal", "scipy.special", "matplotlib"]
packages = ["scipy", "scipy.signal", "scipy.special"]
##packages = ["scipy", "scipy.signal", "scipy.special", "matplotlib", "matplotlib.backends", "matplotlib.mpl-data"]
### construction du dictionnaire des options
options = {"path": path,
"includes": includes,
"excludes": excludes,
"packages": packages,
## "include_files": includefiles,
"include_files":[(matplotlib.get_data_path(),"mpl-data")]
## "include_files":[(matplotlib.get_data_path(),"HDE")]
#### "include_files":[matplotlib.get_data_path(),"C:\\Python27\\Lib\site-packages\\matplotlib\\mpl-data"]
## "bin_path_includes": binpathincludes
}
# création du setup
setup(
name = "GLASDataExtraction",
version = "1",
description = "Extraction et analyse de data GLAS",
author = "Henri",
options = {"build_exe": options},
## executables = [cible_1]
executables=[Executable("main.py")]
)
There are many comments because I tried to simplify as possible the setup.py file without impact in build directory.
After launching
python setup.py build
in DOS window, directory 'build/exe... ' are created.
Inside there are :
library.zip file with many packages (matplotlib is inside but without mpl-data which doesn't looks like a package as there is no init.py file).
many .pyd files
4 directory : imageformats, mpl-data, tcl, tk. mpl-data is there with
its content.
Then, my setup file is created with INNO application in "Program Files (x86)" directory. I launch the installation with this setup file. It looks ok. My program directory is created with few directories and files. Files from "C:\Python27\Lib\site-packages\matplotlib\mpl-data" are among those files. But when I launch the .exe file, I have the error "RuntimeError: Could not find the matplotlib data files".
My configuration is :
WINDOWS 7 64 bits
python 2.7 64 bits
cx_freeze 4.3.3
inno 5.5.5
pyqt4
Thank you Thomas, yes I first run the frozen exe before make the installer. it was OK.
I found a solution: while importing directory, inno copies all the files in the same directory as the exe file (Program Files (x86) directory). But if I define the same directory as frozen exe, I have to add mpl-data in the path Dest dir. in iss INNO script:
the line in the script is :
\build\exe.win-amd64-2.7\mpl-data\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
I add mpl-data directory in the path in iss file, in order to have the same relative path from the exe to mpl-data file in the install directory and in frozen directory :
\build\exe.win-amd64-2.7\mpl-data\*"; DestDir: "{app}\mpl-data\"; Flags: ignoreversion recursesubdirs createallsubdirs
I compile, install... it works
Find and edit the hook-matplotlib.py inside of lib/site-packages/pyinstaller/hooks
edit the data section from: datas = [ (mpl_data_dir, "mpl-data"), ]
to
datas = [ (mpl_data_dir, "matplotlib/mpl-data"), ]

Error while installing camel-jetty feature in Fuse ESB

I am trying to configure Fuse ESB on my Windows 7 machine. Here are the configs.
Configuration
JRE 1.6.0_30
MS VC++ Redistributable - x86 9.0.30729.17
JAVA_HOME set to "C:\Program Files\Java\jre6"
Apache ServiceMix 4.4.1-fuse-02-02
After starting the ServiceMix console, I am trying to install camel-jetty using the following command.
features:install camel-jetty
Which fails with the following message.
Error executing command: URL [mvn:org.apache.camel/camel-http/2.8.0-fuse-02-02]
could not be resolved.
Full log message is as follows.
12:37:45,299 | INFO | l Console Thread | FeaturesServiceImpl | 39 - org.apache.karaf.features.core - 2.2.2.fuse-03-02 | Installing feature camel-jetty 2.8.0-fuse-02-02
12:37:45,299 | INFO | l Console Thread | FeaturesServiceImpl | 39 - org.apache.karaf.features.core - 2.2.2.fuse-03-02 | Installing feature jetty 7.4.5.fuse20111017
12:37:45,299 | INFO | l Console Thread | FeaturesServiceImpl | 39 - org.apache.karaf.features.core - 2.2.2.fuse-03-02 | Installing feature camel-core 2.8.0-fuse-02-02
12:37:45,299 | INFO | l Console Thread | FeaturesServiceImpl | 39 - org.apache.karaf.features.core - 2.2.2.fuse-03-02 | Installing feature camel-http 2.8.0-fuse-02-02
12:37:45,299 | INFO | l Console Thread | FeaturesServiceImpl | 39 - org.apache.karaf.features.core - 2.2.2.fuse-03-02 | Installing feature camel-core 2.8.0-fuse-02-02
12:37:58,718 | INFO | l Console Thread | Console | 32 - org.apache.karaf.shell.console - 2.2.2.fuse-03-02 | Exception caught while executing command
java.lang.RuntimeException: URL [mvn:org.apache.camel/camel-http/2.8.0-fuse-02-02] could not be resolved.
at org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:195)[2:org.ops4j.pax.url.mvn:1.2.6.fuse-01]
at org.apache.felix.bundlerepository.impl.FileUtil.openURL(FileUtil.java:203)[6:org.apache.felix.bundlerepository:1.6.4]
at org.apache.felix.bundlerepository.impl.FileUtil.openURL(FileUtil.java:196)[6:org.apache.felix.bundlerepository:1.6.4]
at org.apache.felix.bundlerepository.impl.DataModelHelperImpl$2.loadEntry(DataModelHelperImpl.java:452)[6:org.apache.felix.bundlerepository:1.6.4]
at org.apache.felix.bundlerepository.impl.DataModelHelperImpl$2.<init>(DataModelHelperImpl.java:411)[6:org.apache.felix.bundlerepository:1.6.4]
at org.apache.felix.bundlerepository.impl.DataModelHelperImpl.createResource(DataModelHelperImpl.java:404)[6:org.apache.felix.bundlerepository:1.6.4]
at org.apache.karaf.features.obr.internal.ObrResolver.resolve(ObrResolver.java:75)[28:org.apache.karaf.features.obr:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.resolve(FeaturesServiceImpl.java:505)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:474)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.doInstallFeature(FeaturesServiceImpl.java:453)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeatures(FeaturesServiceImpl.java:292)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:280)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.internal.FeaturesServiceImpl.installFeature(FeaturesServiceImpl.java:276)[39:org.apache.karaf.features.core:2.2.2.fuse-03-02]
at org.apache.karaf.features.command.InstallFeatureCommand.doExecute(InstallFeatureCommand.java:62)[17:org.apache.karaf.features.command:2.2.2.fuse-03-02]
at org.apache.karaf.features.command.FeaturesCommandSupport.doExecute(FeaturesCommandSupport.java:39)[17:org.apache.karaf.features.command:2.2.2.fuse-03-02]
at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at org.apache.karaf.shell.console.jline.Console.run(Console.java:240)[32:org.apache.karaf.shell.console:2.2.2.fuse-03-02]
at java.lang.Thread.run(Unknown Source)[:1.6.0_30]
Can anybody please help me out here?
The org.ops4j.opx.url.mvn.cfg file contents are as follows
################################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################
#
# If set to true, the following property will not allow any certificate to be used
# when accessing maven repositories through SSL
#
#org.ops4j.pax.url.mvn.certificateCheck=
#
# Path to the local maven settings file.
# The repositories defined in this file will be automatically added to the list
# of default repositories if the 'org.ops4j.pax.url.mvn.repositories' property
# below is not set.
# The following locations are checked for the existence of the settings.xml file
# * 1. looks for the specified url
# * 2. if not found looks for ${user.home}/.m2/settings.xml
# * 3. if not found looks for ${maven.home}/conf/settings.xml
# * 4. if not found looks for ${M2_HOME}/conf/settings.xml
#
#org.ops4j.pax.url.mvn.settings=
#
# Path to the local maven repository which is used to avoid downloading
# artifacts when they already exist locally.
# The value of this property will be extracted from the settings.xml file
# above, or defaulted to:
# System.getProperty( "user.home" ) + "/.m2/repository"
#
#org.ops4j.pax.url.mvn.localRepository=
#
# Default this to false. It's just weird to use undocumented repos
#
org.ops4j.pax.url.mvn.useFallbackRepositories=false
#
# Uncomment if you are behind a web proxy. PAX URL will use the proxy settings
# from the Maven conf/settings.xml file
#
# org.ops4j.pax.url.mvn.proxySupport=true
#
# Disable aether support by default. This ensure that the defaultRepositories
# below will be used
#
org.ops4j.pax.url.mvn.disableAether=true
#
# Comma separated list of repositories scanned when resolving an artifact.
# Those repositories will be checked before iterating through the
# below list of repositories and even before the local repository
# A repository url can be appended with zero or more of the following flags:
# #snapshots : the repository contains snaphots
# #noreleases : the repository does not contain any released artifacts
#
# The following property value will add the system folder as a repo.
#
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}#snapshots,\
file:${karaf.home}/local-repo#snapshots
#
# Comma separated list of repositories scanned when resolving an artifact.
# The default list includes the following repositories:
# http://repo1.maven.org/maven2
# http://repository.apache.org/content/groups/snapshots-group
# http://svn.apache.org/repos/asf/servicemix/m2-repo
# http://repository.springsource.com/maven/bundles/release
# http://repository.springsource.com/maven/bundles/external
# To add repositories to the default ones, prepend '+' to the list of repositories
# to add.
# A repository url can be appended with zero or more of the following flags:
# #snapshots : the repository contains snaphots
# #noreleases : the repository does not contain any released artifacts
#
org.ops4j.pax.url.mvn.repositories= \
http://repo1.maven.org/maven2, \
http://repo.fusesource.com/nexus/content/repositories/releases, \
http://repo.fusesource.com/nexus/content/repositories/snapshots#snapshots#noreleases, \
http://repository.apache.org/content/groups/snapshots-group#snapshots#noreleases, \
http://svn.apache.org/repos/asf/servicemix/m2-repo, \
http://repository.springsource.com/maven/bundles/release, \
http://repository.springsource.com/maven/bundles/external
This error means Fuse ESB could not found the camel-http artifact from any repository available.
Fuse search in its local repository first and then on configured remote maven repositories.
All the configuration is done in <%Fuse Install dir%>\etc\org.ops4j.pax.url.mvn.cfg
See http://fusesource.com/docs/esb/4.4/esb_deploy_osgi/Locate-RunTime.html for more details about how to configure it properly.