Docker build failing while installing pandas in docker in python2.7-alpine - python

I am running a flask application in Docker. I am also using Pandas. I am using python2.7-alpine image. Earlier it was working fine i.e. I was able to build images with the same configuration.
But now I am unable to build the image as it says:
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1
I cannot change the python version. As my application is built on python2 and was as expected for a long back.
My Dockerfile
FROM python:2.7-alpine
RUN echo "ipv6" >> /etc/modules;
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/main" > /etc/apk/repositories; \
# echo "http://dl-cdn.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-2.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-3.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-4.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories; \
# echo "http://dl-5.alpinelinux.org/alpine/latest-stable/community" >> /etc/apk/repositories
RUN rm -rf /var/cache/apk/* && \
rm -rf /tmp/* && \
apk update && \
apk add --update bash sudo
#================================================================
# add dependencies
#================================================================
RUN apk add --update --no-cache g++ gcc libffi-dev make gpgme p11-kit openssl-dev openssh
#================================================================
# pip and required modules install
#================================================================
### Upgrade pip to prevent errors
RUN pip install setuptools --upgrade
ADD requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
The full error track back is:
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-Sm9A7D/pandas/setup.py", line 749, in <module>
**setuptools_kwargs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "/usr/local/lib/python2.7/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 717, in fetch_build_eggs
replace_conflicting=True,
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 782, in resolve
replace_conflicting=replace_conflicting
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1065, in best_match
return self.obtain(req, installer)
File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1077, in obtain
return installer(requirement)
File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 784, in fetch_build_egg
return cmd.easy_install(req)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 679, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 705, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 890, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1158, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1144, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 253, in run_setup
raise
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/contextlib.py", line 35, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 166, in save_modules
saved_exc.resume()
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 141, in resume
six.reraise(type, exc, self._tb)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 154, in save_modules
yield saved
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 195, in setup_context
yield
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 250, in run_setup
_execfile(setup_script, ns)
File "/usr/local/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/tmp/easy_install-2BV0tR/numpy-1.17.0rc1/setup.py", line 31, in <module>
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Sm9A7D/pandas/
The command '/bin/sh -c pip install -r /tmp/requirements.txt' returned a non-zero code: 1

The error tells you the reason:
File "/tmp/easy_install-r9No9Q/numpy-1.17.0rc1/setup.py", line 31, in
def is_platform_mac():
RuntimeError: Python version >= 3.5 required.
From pandas 0.23.4 source: we can see the minimum version for numpy is 1.9.0:
min_numpy_ver = '1.9.0'
So, if you did not install a version by yourself, pandas will just install a newest suitable version of numpy which >1.9.0 for you, here is numpy-1.17.0rc1, but it needs >python3.5 as seen here, so failure happens.
python_requires='>=3.5'
Finally, if you check the source code of numpy, you will find 1.16.4 is the last version which support python2.7, see this,
python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*',
So, final solution:
Pre-install numpy 1.16.4, then pandas find there is a suitable numpy there, and will not install a newest numpy for you. As a result, no error will happen, detail steps as next:
apk update
apk add build-base
pip install numpy==1.16.4
pip install pandas==0.23.4
For Dockerfile, add above command to one RUN could make the fix:
RUN apk update && \
apk add build-base && \
pip install numpy==1.16.4 && \
pip install pandas==0.23.4
Additional, you said in question:
Earlier it was working fine i.e. I was able to build images with the same configuration.
This is because numpy latest version was just updated July.1st 2019, before that, it always 1.16.4 version which don't have issue for python27, but now, things changed...

Related

I don't know what is happening when is tried to upgrade pip fro 20.2.2 to 20.2.3 is showing errors

C:\Users\sulav>python get-pip.py
python: can't open file 'get-pip.py': [Errno 2] No such file or directory
C:\Users\sulav>python -m pip install -U pip
Collecting pip
Using cached pip-20.2.3-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.2
Uninstalling pip-20.2.2:
Successfully uninstalled pip-20.2.2
Rolling back uninstall of pip
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip3.7.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip3.7.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\scripts\pip3.exe
from C:\Users\sulav\AppData\Local\Temp\pip-uninstall-plw0b_z7\pip3.exe
Moving to c:\users\sulav\appdata\roaming\python\python37\site-packages\pip-20.2.2.dist-info\
from c:\users\sulav\appdata\roaming\python\python37\site-packages\~ip-20.2.2.dist-info
Moving to c:\users\sulav\appdata\roaming\python\python37\site-packages\pip\
from c:\users\sulav\appdata\roaming\python\python37\site-packages\~ip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\base_command.py", line 216, in _main
status = self.run(options, args)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\cli\req_command.py", line 182, in wrapper
return func(self, options, args)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\commands\install.py", line 421, in run
pycompile=options.compile,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\__init__.py", line 90, in install_given_reqs
pycompile=pycompile,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\req\req_install.py", line 821, in install
requested=self.user_supplied,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 860, in install_wheel
requested=requested,
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 762, in _install_wheel
generated_console_scripts = maker.make_multiple(scripts_to_generate)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 418, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_internal\operations\install\wheel.py", line 498, in make
return super(PipScriptMaker, self).make(specification, options)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 407, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 307, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 242, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\sulav\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 386, in _get_launcher
raise ValueError(msg)
ValueError: Unable to find resource t64.exe in package pip._vendor.distlib
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the 'C:\Users\sulav\AppData\Local\Programs\Python\Python37\python.exe -m pip install --upgrade pip' command.
You need to download get-pip.py and make sure that you are in that directory when you are trying to install it. For instance i see that the dirctory you are in is C:\Users\sulav> make sure that it is downloaded to this directory.

Buildozer How can I solve "--ndk-api=21" error

I have small app for Android that is kivy-python based. To turn it into an APK I had to use buildozer.
When I run this final step:
buildozer android debug deploy run I get this error.
I changed the NDK values in the spec files, or I changed codes. In short, what I did was looked at similar errors. I tried reported solutions and they didn't work. I don't even know what the problem is.
Related logs :
[WARNING]: Missing executable: pkg-config is not installed
[WARNING]: Missing executable: libtoolize is not installed
[INFO]: -> running autogen.sh
working: /home/abra/DeskException in thread background thread for pid 3917:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self._target(*self.args, **self._kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 1540, in wrap
fn(*args, **kwargs)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2459, in background_thread
handle_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 2157, in fn
return self.command.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
ErrorReturnCode_127:
RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"_main_", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1189, in <module>
main()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 1183, in main
ToolchainCL()
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 666, in _init_
getattr(self, args.subparser_name.replace('-', '_'))(args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 152, in wrapper_func
build_dist_from_args(ctx, dist, args)
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/toolchain.py", line 205, in build_dist_from_args
args, "ignore_setup_py", False
File "pythonforandroid/build.py", line 557, in build_recipes
File "/home/abra/Desktop/questionapp/.buildozer/android/platform/python-for-android/pythonforandroid/recipes/libffi/_init_.py", line 33, in build_arch
shprint(sh.Command('./autogen.sh'), _env=env)
File "pythonforandroid/logger.py", line 178, in shprint
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 863, in next
self.wait()
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 792, in wait
self.handle_command_exit_code(exit_code)
File "/home/abra/.local/lib/python2.7/site-packages/sh.py", line 815, in handle_command_exit_code
raise exc
sh.ErrorReturnCode_127:
RAN: /home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh
STDOUT:
/home/abra/Desktop/questionapp/.buildozer/android/platform/build/build/other_builds/libffi/armeabi-v7a__ndk_target_21/libffi/autogen.sh: 2: exec: autoreconf: not found
STDERR:
# Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=myapp --bootstrap=sdl2 --requirements=python3,kivy --arch armeabi-v7a --copy-libs --color=always --storage-dir="/home/abra/Desktop/questionapp/.buildozer/android/platform/build" --ndk-api=21
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
# Please read the full log, and search for it before
# raising an issue with buildozer itself.
# In case of a bug report, please add a full log with log_level = 2
I solved this problem.If someone encounters this error I solved by following these steps
sudo apt update
sudo apt-get install autoconf
pip install --upgrade buildozer
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5
pip3 install --user --upgrade cython virtualenv

virtualenv installation SSLError: The read operation timed out

I am trying to deploy python flask application using apache2 and mod-wsgi.
I am following this link.
While installing mog-wsgi using the command sudo apt-get install libapache2-mod-wsgi ,I see these lines at the end
apache2_invoke: Enable module wsgi
Action 'configtest' failed.
The Apache error log may have more information.
apache2_reload: Your configuration is broken. Not restarting Apache 2
Is this a smooth installation?
Also, in step 1 of the link when I tried to create a virtual environment using the command
sudo virtualenv venv
This gives me error sudo: virtualenv: command not found
So, I tried to install virtualenv using sudo pip install virtualenv, I am getting this huge error in red(exception).
Downloading/unpacking virtualenv
Downloading virtualenv-15.0.1-py2.py3-none-any.whl (1.8MB): 733kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1198, in prepare_files
do_download,
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1376, in unpack_url
self.session,
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 572, in unpack_http_url
download_hash = _download_url(resp, link, temp_location)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 433, in _download_url
for chunk in resp_read(4096):
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 421, in resp_read
chunk_size, decode_content=False):
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 225, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "/usr/share/python-wheels/urllib3-1.7.1-py2.py3-none-any.whl/urllib3/response.py", line 174, in read
data = self._fp.read(amt)
File "/usr/lib/python2.7/httplib.py", line 573, in read
s = self.fp.read(amt)
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
File "/usr/lib/python2.7/ssl.py", line 341, in recv
return self.read(buflen)
File "/usr/lib/python2.7/ssl.py", line 260, in read
return self._sslobj.read(len)
SSLError: The read operation timed out
Storing debug log for failure in /home/myname/.pip/pip.log
What could be the problem?
Please use apt-get install virtualenv or apt-get install python-virtualenv (depending on your OS version) instead of polluting the system with packages installed by sudo pip install.

Vaultier is unusable for docker/ubuntu/debian (Python)

I am looking for a good Password safe for my Company. I wanted to test Vaultier, but it newer works as expected. Neither with Docker or other Platforms. There is always and error, if its Docker i get that output.
I'm no python specialist, but making pip install --upgrade made the installation just missing the whole app.
i followed these guides https://www.vaultier.org/install/
sudo docker run -t -i --name vaultier -p 80:8088 rclick/vaultier:latest -e "VAULTIER_DOMAIN=vaultier.bla.com"
Error: invalid value for -e 'VAULTIER_DOMAIN=vaultier.bla.com': bad logging level name 'VAULTIER_DOMAIN=vaultier.bla.com'
For help, use /usr/bin/supervisord -h
Starting the Docker without this value, gives a (400 Bad Request)
Using Ubuntu:
Traceback (most recent call last):
File "/opt/vaultier/venv/bin/vaultier", line 5, in <module>
from pkg_resources import load_entry_point
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 2720, in <module>
parse_requirements(__requires__), Environment()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pkg_resources.py", line 592, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (six 1.4.1 (/opt/vaultier/venv/lib/python2.7/site-packages), Requirement.parse('six>=1.7'))
Using Debian:
Traceback (most recent call last):
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 295, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/req.py", line 707, in install
cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/pip/util.py", line 716, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command /opt/vaultier/venv/bin/python2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-08foqW/psycopg2/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-UUDq9M-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/vaultier/venv/include/site/python2.7 failed with error code 1 in /tmp/pip-build-08foqW/psycopg2
Any ideas on how to avoid that fail, or fixing this?
UPDATE
after the "six" problem solution i received a new error while running vaultier setup
File "/opt/vaultier/venv/bin/vaultier", line 9, in <module>
load_entry_point('Vaultier==0.7.5', 'console_scripts', 'vaultier')()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier/vaultier/runner.py", line 231, in main
settings_envvar='VAULTIER_CONF'
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/logan/runner.py", line 169, in run_app
management.execute_from_command_line([runner_name, command] + command_args)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier/vaultier/management/commands/setup.py", line 22, in handle
management.call_command('syncdb')
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 159, in call_command
return klass.execute(*args, **defaults)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/management/commands/syncdb.py", line 68, in handle_noargs
migrations = migration.Migrations(app_label)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 64, in __call__
self.instances[app_label] = super(MigrationsMetaclass, self).__call__(app_label_to_app_module(app_label), **kwds)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 90, in __init__
self.set_application(application, force_creation, verbose_creation)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/south/migration/base.py", line 154, in set_application
module = importlib.import_module(self.migrations_module())
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
__import__(name)
File "/opt/vaultier/venv/local/lib/python2.7/site-packages/kombu/transport/django/migrations/__init__.py", line 16, in <module>
raise ImproperlyConfigured(SOUTH_ERROR_MESSAGE)
django.core.exceptions.ImproperlyConfigured:
For South support, customize the SOUTH_MIGRATION_MODULES setting
to point to the correct migrations module:
SOUTH_MIGRATION_MODULES = {
'kombu_transport_django': 'kombu.transport.django.south_migrations',
}
UPDATE2 -FIX
I couldnt find any solution online, so i tried another version of south and see there ... it works. :)
>>> DB is initialized, you can now try to run Vaultier using 'vaultier runserver'
(venv)root#Vaultier:/opt/vaultier# vaultier runserver
In the requirements.txt from vaultier, or setup.py ... doesnt matter which one you use. just set "South==1.0.2"
Dont forget to set "Six==1.9"
Have fun!
I found the same problem as you, the steps I did in Ubuntu to fix were:
Download Vaultier last version: wget https://pypi.python.org/packages/source/V/Vaultier/Vaultier-0.7.5.tar.gz
Unpack & unzip it: tar -xzvf Vaultier-0.7.5.tar.gz
Edit setup.py file and find the line that contains six==1.4,
change for this six==1.9,
Install it running: python setup.py install
If you wanna use the Docker Image the current Vaultier documentation is kind of confusing.
Try this:
Pull the latest Image (do not run the image!)
sudo docker pull rclick/vaultier:latest
Run the Image (replace EXAMPLE.COM with your desired Domain):
sudo docker run --name vaultier -p 80:80 -e "VAULTIER_DOMAIN=EXAMPLE.COM" rclick/vaultier:latest
After struggling many days, i found out how to install it :
If you install it with "apt-get install vaultier", then you will have the South and Six version issue, so just run in parallel "while [ 1 ]; do sed -i 's/six==1.4.1/six==1.9/' /tmp/pip*/setup.py; sed -i 's/South==0.8.4/South==1.0.2/' /tmp/pip*/setup.py;done 2>/dev/null"
After the installation succeed, if you run "vaultier check" and you got "No module named vaultier.runner", set the PYTHON_PATH variable : "export PYTHONPATH="/opt/vaultier/venv/local/lib/python2.7/site-packages/vaultier"", go to /opt/vaultier/venv/bin and try again.
I got issues with sending email (to invite and share with others). The environment variable FROM_EMAIL or VAULTIER_FROM_EMAIL wasn't effective, so Vaultier was using "noreply#vauliter.YOURDOMAIN.LOCAL" in the "from:" of the SMTP exchange.
I manually entered the desired email in "/opt/vaultier/venv/lib/python2.7/site-packages/vaultier/vaultier/business/mailer.py" line 33 : self.from_email = 'vaultier#YOURDOMAIN.COM'
If i got enough time, i'll make an OVA based on a CentOS 7 fully operationnal.
By the way, it's a good app, looks nice and do well it's job. By the way, it's the only free one that you can host. There was another one but ugly and not so easy to use.

Issues in Installing Python packages in webfaction

I am trying to install packages using PIP but it doesn't work for me initially it gives the permission denied error and after that when I tried to use easy_install it gives me this error :->
Searching for mezzanine
Reading https://pypi.python.org/simple/mezzanine/
Reading http://github.com/stephenmcd/mezzanine/
Reading http://mezzanine.jupo.org/
Best match: Mezzanine 3.1.8
Downloading https://pypi.python.org/packages/source/M/Mezzanine/Mezzanine-3.1.8.tar.gz#md5=dcc46016b866ea8de1c87fb9dffd9163
Processing Mezzanine-3.1.8.tar.gz
Writing /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/setup.cfg
Running Mezzanine-3.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-2cSSS_/Mezzanine-3.1.8/egg-dist-tmp-uDjreS
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1924, in main
with_ei_usage(lambda:
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1911, in with_ei_usage
return f()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1928, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup
dist.run_commands()
File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in run_commands
self.run_command(cmd)
File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command
cmd_obj.run()
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 374, in run
self.easy_install(spec, not self.no_deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 609, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 639, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 825, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1031, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/command/easy_install.py", line 1016, in run_setup
run_setup(setup_script, args)
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 68, in run_setup
DirectorySandbox(setup_dir).run(
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 120, in run
return func()
File "/usr/local/lib/python2.4/site-packages/setuptools/sandbox.py", line 71, in <lambda>
{'__file__':setup_script, '__name__':'__main__'}
File "setup.py", line 22
with open(e, "r") as f:
^
SyntaxError: invalid syntax
After this when I again try to use pip then I am getting different error (not permission denied) :
File "/home/rishi/bin/pip", line 8, in ?
sys.exit(
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/usr/local/lib/python2.4/site-packages/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/__init__.py", line 9, in ?
from pip.log import logger
File "/home/rishi/lib/python2.4/pip-1.5.6-py2.4.egg/pip/log.py", line 19
real_consumer = (consumer if not isinstance(consumer, colorama.AnsiToWin32)
^
SyntaxError: invalid syntax
Now I don't know what I am doing wrong , can anybody help me ?
EDIT :- syntex errro solved due to wrong python version , I was using 2.4 .
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/mezzanine'
$which pip result is
~/bin/pip
Just add the --user option to your pip command, it will install with your logged in user permissions:
pip2.7 install mezzanine --user
as Daniel Roseman noted - the syntax error came from using Python2.4
the permission problem is caused by trying to install into system Python, what requires sudo or being root
Possible solutions
Install into system Pyhton (using sudo)
$ sudo pip install mezzanine
This will spoil the system Python and is not much recommended. It would be well acceptable if you are e.g. under Docker.
Install into user profile
$ pip install --user mezzanine
It will install the package into user scheme and will not spoil system Python.
This is more acceptable, but can soon become messy environment to run code in, as Python will import form user scheme, sometime from system.
Use virtualenv
Assuming you have virtualenv installed:
$ cd ~/projects
$ mkdir mezza
$ cd mezza
$ virtualenv venv
$ source venv/bin/activate
(venv)$ pip install mezzanine
$ pip freeze
mezzanine==3.1.8
(there will be a bit more lines from freeze).
This installs into virtualenv, which is easy to recreate, destroy, and does not mess up with other environments.
With virtulanevwrapper you will get set of additional tools, which will simplify your environment a lot.

Categories

Resources