Getting error while running buildout for Setting Plumi and Zope Server on Linux using command "python3 bootstrap.py -c production.cfg" - plone

I was installing Plumi for creating a production site. after installing plumi.app i faced below error whie running buildout using command : python3 bootstrap.py -c production.cfg
Note:: Zope is installed and zope user is added..
The ERROR IS BELOW::enter image description here
root#Saif:/home/plumi.app# /bin/python3 bootstrap.py && ./bin/buildout -v
ez_setup.py is deprecated and when using it setuptools will be pinned to 33.1.1 since it's the last version that supports setuptools self upgrade/installation, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptools
Downloading https://pypi.io/packages/source/s/setuptools/setuptools-33.1.1.zip
Extracting in /tmp/tmpvwkpnumd
Now working in /tmp/tmpvwkpnumd/setuptools-33.1.1
Building a Setuptools egg in /tmp/tmpgfkbh3om
warning: no files found matching '*' under directory 'setuptools/_vendor'
/tmp/tmpgfkbh3om/setuptools-33.1.1-py3.8.egg
Couldn't find index page for 'zc.buildout' (maybe misspelled?)
Couldn't find index page for 'zc.buildout' (maybe misspelled?)
No local packages or working download links found for zc.buildout
error: Could not find suitable distribution for Requirement.parse('zc.buildout')
Traceback (most recent call last):
File "bootstrap.py", line 171, in <module>
raise Exception(
Exception: Failed to execute command:
'/bin/python3', '-c', 'from setuptools.command.easy_install import main; main()', '-mZqNxd', '/tmp/tmpgfkbh3om', 'zc.buildout'
root#Saif:/home/plumi.app# ^C
root#Saif:/home/plumi.app# python3 bootstrap.py -c production.cfg
ez_setup.py is deprecated and when using it setuptools will be pinned to 33.1.1 since it's the last version that supports setuptools self upgrade/installation, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptools
Downloading https://pypi.io/packages/source/s/setuptools/setuptools-33.1.1.zip
Extracting in /tmp/tmp6dqehae9
Now working in /tmp/tmp6dqehae9/setuptools-33.1.1
Building a Setuptools egg in /tmp/tmpdja0839z
warning: no files found matching '*' under directory 'setuptools/_vendor'
/tmp/tmpdja0839z/setuptools-33.1.1-py3.8.egg
Couldn't find index page for 'zc.buildout' (maybe misspelled?)
Couldn't find index page for 'zc.buildout' (maybe misspelled?)
No local packages or working download links found for zc.buildout
error: Could not find suitable distribution for Requirement.parse('zc.buildout')
Traceback (most recent call last):
File "bootstrap.py", line 171, in <module>
raise Exception(
Exception: Failed to execute command:
'/usr/bin/python3', '-c', 'from setuptools.command.easy_install import main; main()', '-mZqNxd', '/tmp/tmpdja0839z', 'zc.buildout'

warning: no files found matching '*' under directory 'setuptools/_vendor'
I found out that setuptools version 33.1.1 doesn't have vendor folder.
https://github.com/pypa/setuptools/tree/v33.1.1/setuptools

Related

Module Import Error with Nosetests and Tox

In my project, I am using tox with nosetests. Using PyCharm, my tox pipeline was passing completely including all the tests. When I execute tox on a Ubuntu18.04 container with python3, it gives me the following error:
ImportError: No module named 'my_project'
leading to the following error at the end:
ERROR: InvocationError for command /.tox/py36/bin/nosetests (exited with code 1)
my_project is the name of the module I am testing and the directory structure looks like this under /, the root dir from which I am executing tox:
my_project/
tests/
tox.ini
setup.cfg
other files
My tox.ini looks as follows:
[tox]
envlist = py36
[testenv]
commands = python3 setup.py build
nosetests
deps = -r{toxinidir}/test-requirements.txt
I have tried to provide the path to project in different ways to nosetests command but none of that works. One line that interests me is in the initial output of tox:
py36 installed: my_project # file:///.tox/.tmp/package/1/my_project-0.4.post52.dev256143400.zip,
which leads me to think if this is the reason that nosetests does not find my_project.
For details, the stack trace for the error is as follows:
ERROR: Failure: ImportError (No module named 'my_project')
Traceback (most recent call last):
File "/.tox/py36/lib/python3.6/site-packages/nose/failure.py", line 39, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/.tox/py36/lib/python3.6/site-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/.tox/py36/lib/python3.6/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/.tox/py36/lib/python3.6/site-packages/nose/importer.py", line 79, in importFromDir
fh, filename, desc = find_module(part, path)
File "/usr/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name) ImportError: No module named 'my_project'
I see three possible offenders.
(1) python3 setup.py build should not exist in the commands section.
# the build command is redundant, there is a special option for this.
commands = python3 setup.py build
nosetests
# The install command with it's default
install_command=python -m pip install {opts} {packages}(ARGV)
deps = -r{toxinidir}/test-requirements.txt
(2) And with Pycharm you might have added your project as a sources root (right click folder > mark directory as > sources root). Or configured it otherwise (PATH variable perhaps?) that makes my_project available in context to running it in Pycharm? This should not happen inside tox though, unless you have whitelist externals or sitepackages turned to True..
So when installed on a container this link does not exist.
(3) I can't help but notice the abscence of a setup.py or pyproject.toml. Files used to install my_project. E.g. run this command locally and debug your installation if it doesn't work:
pip install .

Error in install_keras() in R since Ubuntu update

I used the book "Deep Learning with R" since one month now, and it enables me to make my first neural networks.
I am using Ubuntu. Until 2 days ago, everything was OK and worked fine. But two days ago I updated my Ubuntu to Ubuntu 18.02. Since then, my R code is not working anymore.
I have re-done what is recommended in the book (and what has worked one month ago):
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python-pip python-dev
$ sudo apt-get install build-essential cmake git unzip pkg-config libopenblas-dev liblapack-dev
I had no error.
then in R:
install.packages("keras")
library(keras)
install_keras()
This last command is supposed to install the core Keras library along with its dependencies in a Python virtual environment using TensorFlow.
But I obtained the following error that I really do not understand:
> install_keras()
Using existing virtualenv at ~/.virtualenvs/r-tensorflow
Upgrading pip ...
Traceback (most recent call last):
File "/home/baragatt/.virtualenvs/r-tensorflow/bin/pip", line 7, in <module>
from pip._internal import main
File "/home/baragatt/.virtualenvs/r-tensorflow/local/lib/python2.7/site-packages/pip/_internal/__init__.py", line 5, in <module>
import logging
File "/usr/lib/python2.7/logging/__init__.py", line 26, in <module>
import sys, os, time, cStringIO, traceback, warnings, weakref, collections
File "/usr/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Erreur : Error 1 occurred installing TensorFlow
I have re-installed R, python, tensorflow, but I always have the same error. I do not understand this error. Maybe this is a problem with the virtualenv?
Can someone help me please? It is so frustrating, because two days ago my code was running, and now impossible to work...
I am working with Ubuntu 18.02, at the installed versions are python 2.7.15~rc1-1, R-3.4.4 and tensorflow-1.10.0.
Thanks a lot for this post. I do not really understand what the commands in this post are supposed to fix. But I have done the following:
cd /home/baragatt/.virtualenvs/r-tensorflow/
Then, as proposed in the post:
virtualenv . --system-site-packages
I obtained the following messages:
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/baragatt/.virtualenvs/r-tensorflow/bin/python2
Not overwriting existing python script /home/baragatt/.virtualenvs/r-tensorflow/bin/python (you must use /home/baragatt/.virtualenvs/r-tensorflow/bin/python2)
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 946, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python3/dist-packages/virtualenv.py", line 1417, in install_python
os.symlink(py_executable_base, full_pth)
OSError: [Errno 17] File exists
I also tried:
virtualenv -p /usr/bin/python2.7 .
And I obtained:
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in /home/baragatt/.virtualenvs/r-tensorflow/bin/python2.7
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/virtualenv.py", line 2375, in <module>
main()
File "/usr/lib/python3/dist-packages/virtualenv.py", line 724, in main
symlink=options.symlink)
File "/usr/lib/python3/dist-packages/virtualenv.py", line 946, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/lib/python3/dist-packages/virtualenv.py", line 1278, in install_python
shutil.copyfile(executable, py_executable)
File "/usr/lib/python2.7/shutil.py", line 97, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 40] Too many levels of symbolic links: '/home/baragatt/.virtualenvs/r-tensorflow/bin/python2.7'
I finally find a solution, by looking at different forums.
I thought that the problem should be because of the virtualenvironment that should be created when doing the following command in R.
install_keras()
Hence, I deleted the virtual environment(s) by deleting the directory in which these environements are located (I imagine).
cd ~/.virtualenvs
rm -r r-tensorflow/
Then I have tried the following commands in R
install.packages("keras")
library(keras)
install_keras()
And it works! Honestly, I still do not understand what was the problem that occured after my Ubuntu update.

Apache Airflow 1.9 install on debian 8 from GitHub

I installed Apache airflow 1.9 from GitHub thanks to this command line on debian 9: pip install git+https://github.com/apache/incubator-airflow.git#v1-9-stable
However, I have an error during the airflow initdb caused by Fernet, do you know how to solve this issue?
INFO [alembic.runtime.migration] Running upgrade 947454bf1dff -> d2ae31099d61, Increase text size for MySQL (not relevant for other DBs' text types)
[2017-12-27 17:19:24,586] {models.py:643} ERROR - Failed to load fernet while encrypting value, using non-encrypted value.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 639, in set_extra
fernet = get_fernet()
File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 103, in get_fernet
raise AirflowException('Failed to import Fernet, it may not be installed')
AirflowException: Failed to import Fernet, it may not be installed
[2017-12-27 17:19:24,601] {models.py:643} ERROR - Failed to load fernet
And how can I specify extrapackage like in pip install apache-airflow[gcp-api] from my previous pip command install with GitHub?
How to install the latest 1.9.0RC too? I have an assertionError.
The answer marked as good have a broken link, if you have landed here as me and it continues broken, these steps have worked for me:
pip install cryptography
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
Add the generated key to the config file airflow.cfg, fernet_key = YOUR_GENERATED_KEY
During install from source you have to replace fernet_key in airflow.cfg such as you can find in the docs here.
In apache-airflow documentation, the script for generating fernet key is apparently wrong.
it says to use the following script.
from cryptography.fernet import Fernet
fernet_key= Fernet.generate_key()
print(fernet_key) # your fernet_key, keep it in secured place!
but it raises an exception at 'airflow initdb' command.
to solve this instead of Fernet.generate_key() use Fernet.generate_key().decode() as shown in #skozz answer.

liberasurecode has deprecating version when install swift-all-in-one

I was install openstack swift-all-in-one on my virtual mechine with system Ubuntu Destop 14.04.
It told me that my liberausercode has deprecating version that I need to upgrade when I excute '$HOME/swift/.unittests' in terminal. But the question is how can I upgrade it.
Here is the response:
liberasurecode[11645]: liberasurecode_backend_open: dynamic linking error libJerasure.so.2: cannot open shared object file: No such file or directory
ERROR: Failure: MissingSectionHeaderError (File contains no section headers. file: /etc/swift/swift.confg, line: 1 ' cd $HOME/swift/doc; sudo cp -r saio/swift /etc/swift; cd -\n')
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/nose/loader.py", line 418, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
MissingSectionHeaderError: File contains no section headers.
file: /etc/swift/swift.confg, line: 1
' cd $HOME/swift/doc; sudo cp -r saio/swift /etc/swift; cd -\n'
pyeclib: WARNING: DEPRECATED WARNING: your liberasurecode 1.0.9 will be deprecated in the near future because of the issue https://bugs.launchpad.net/swift/+bug/1639691; Please upgrade to >=1.3.1 and rebuild pyeclib to suppress this message
--------------------- >> end captured logging << ---------------------
FAILED (errors=1)
/root
On websit : https://github.com/openstack/liberasurecode, I find the answer how to update the library.

Troubleshooting Parse Errors when running robot tests on Plone

I'm really not sure what's wrong with my setup. The robot tests were added recently and we've seen them run successfully on another developer's OS X machine.
I'm attempting to run the same robot tests on an Ubuntu machine with Plone and Firefox installed. The package is https://github.com/collective/collective.academicprogrammes
I had to add plone.app.robotframework to the [test] section of my develop.cfg file.
This is what my develop.cfg looks like now:
[sources]
collective.academicprogrammes = git git#github.com:collective/collective.academicprogrammes.git
[buildout]
test-packages =
collective.academicprogrammes[test]
extends =
buildout.cfg
extensions +=
mr.developer
eggs +=
Products.DocFinderTab
plone.reload
collective.academicprogrammes
parts +=
test
diazotools
zopeskel
robot
always-checkout = force
sources = sources
auto-checkout = *
[test]
recipe = zc.recipe.testrunner
defaults = ['--exit-with-status',
'--auto-color', '--auto-progress']
eggs =
${buildout:eggs}
${buildout:test-packages}
[zopeskel]
recipe = zc.recipe.egg
eggs =
ZopeSkel
Paste
PasteDeploy
PasteScript
zopeskel.diazotheme
zopeskel.dexterity
zest.releaser
${buildout:eggs}
[robot]
recipe = zc.recipe.egg
eggs =
Pillow
${test:eggs}
plone.app.robotframework
After running bin/buildout -c develop.cfg to install everything I
attempted to run bin/test -t robot I get the following errors:
File "parser.pxi", line 569, in
lxml.etree._ParserContext._handleParseResultDoc
(src/lxml/lxml.etree.c:74567) File "parser.pxi", line 650, in
lxml.etree._handleParseResult (src/lxml/lxml.etree.c:75458) File
"parser.pxi", line 590, in lxml.etree._raiseParseError
(src/lxml/lxml.etree.c:74791)
File "lxml.etree.pyx", line 2756, in lxml.etree.fromstring
(src/lxml/lxml.etree.c:54726) bash: syntax error near unexpected token
(' (precise)david#localhost:~/Plone/zeocluster$ File "parser.pxi",
line 1571, in lxml.etree._parseMemoryDocument
(src/lxml/lxml.etree.c:82792) bash: syntax error near unexpected token
... File "parser.pxi",
line 1450, in lxml.etree._parseDoc (src/lxml/lxml.etree.c:81590) bash:
syntax error near unexpected token('
And it ends with:
AssertionError: Setup failed: WebDriverException: Message: 'Can\'t
load the profile. Profile Dir: /tmp/tmpqsX6Ky/webdriver-py-profilecopy
Firefox output: Gtk-Message: Failed to load module
"canberra-gtk-module"\n*** LOG addons.xpi: startup\n*** LOG
addons.xpi: checkForChanges\n*** LOG addons.xpi: No changes
found\n**********************************\n*
Call to xpconnect wrapped JSObject produced this error:
*\n[Exception... "\'[JavaScript Error: "this.updateDisplay is not a function" {file: "chrome://browser/content/search/search.xml" line:
83}]\' when calling method:
[nsIBrowserSearchInitObserver::onInitComplete]" nsresult: "0x80570021
(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame ::
resource://gre/components/nsSearchService.js :: onSuccess :: line
3257" data:
yes]\n**********************************\n'
The error is two-fold. One has to do with the fact that I installed a lightweight Linux OS that didn't include all the dependencies. Specifically I had to install libcanberra.
To do this on Ubuntu I ran the following command 'sudo apt-get install libcanberra-gtk-module'. That was enough to fix the error about canberra-gtk-module.
The second issue was related to the version of Firefox used. It turns out that Selenium 2.34 is not compatible with Firefox 27 (the browser I'm using).
see:
http://selenium.googlecode.com/git/py/CHANGES
There are two options, upgrade Selenium to 2.40.0
OR
run robot browser tests against Firefox 25.
I opted to get Firefox 25 and use it when running tests.
Related information about this issue can be found here:
http://seleniumsimplified.com/problems-running-webdriver-on-firefox-26/
http://support.mozilla.org/en-US/questions/986545

Resources