I am trying to visualize the database diagram in django.
in Docker file I have:
RUN apt-get install -y python3-dev graphviz libgraphviz-dev
RUN apt-get install -y python-pygraphviz pkg-config
and in requirements.txt I have:
django, psycopg2, djangorestframework, PyJWT, gunicorn, channels, django-extensions, graphviz, cGraph, pygraphviz
but I get this error :
Building wheel for pygraphviz (setup.py): started
Building wheel for pygraphviz (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = ...
----------------------------------------
ERROR: Failed building wheel for pygraphviz
Running setup.py clean for pygraphviz
Successfully built cGraph
Failed to build pygraphviz ... ERROR: Service 'web' failed to build: The command '/bin/sh -c pip install -r requirements.txt' returned a non-zero code: 1
any idea about this error?
I think you have the wrong Package, try it with
docker-compose <-f local.yml> run --rm <containername> pip install graphviz
Or add it to your requirements:
graphviz==0.16 or 0.1*
Also change your Dockerfile RUN to:
RUN pip install -r /requirements/local.txt
dont call every single library.
Little late but hope that helps, Cheers.
I just upgraded my linux build slaves and since then my sonarqube stopped working.
Run to reproduce:
docker run -it ubuntu:18.04 bash
apt-get update
apt-get install wget unzip
wget 192.168.1.5:9000/static/cpp/build-wrapper-linux-x86.zip
unzip build-wrapper-linux-x86.zip
cd build-wrapper-linux-x86
./build-wrapper-linux-x86-64 --out-dir test ls
ERROR: ld.so: object '/build-wrapper-linux-x86/libinterceptor-${PLATFORM}.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
Docker images 16.04, 16.10 are working, 17.10, 18.04 are not working.
The PLATFORM env variable is empty, but i guess it is exported by the build-wrapper script.
Anyone any idea?
I was able to run the C++ Program and build & test it using GitLab CI unit with the help of Docker Image of gcc. But now I want to compile the program in docker using cmake instead of g++. How to change the '.gitlab-ci.yml' file to support cmake.
Current File : .gitlab-ci.yml
image: gcc
before_script:
- apt-get install --yes cmake libmatio-dev libblas-dev libsqlite3-dev libcurl4-openssl-dev
- apt-get install --yes libarchive-dev liblzma-dev
build:
script:
- ./runner.sh
- ./bin/hello
./runner.sh
cmake -H. -Bbuild
cmake --build build -- -j3
I think you need to add apt-get update in order to get cmake to install. See this
image: gcc
before_script:
- apt-get update --yes
- apt-get install --yes cmake
build:
script:
- ./runner.sh
- ./bin/hello
In general, you can figure stuff out by jumping into the docker image to debug (in your case the image is the debian-based gcc:latest):
sudo docker run -it --rm gcc
If you had run your original apt-get install command inside the gcc container, you would have seen following error message that you could have then googled to figure out that apt-get update was needed
sudo docker run -it --rm gcc apt-get install --yes cmake
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package cmake is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'cmake' has no installation candidate
As this blog post mentions, you can do a test run locally by downloading the gitlab-runner executable:
gitlab-runner exec docker build
Running the gitlab-runner locally will have gitlab clone your repo and run through all the steps in the .gitlab-ci.yml and you can see the output and debug locally rather quickly.
I have successfully built an image and if I go in through bash, I am able to execute "lua" from the command line.
Here is part of the build:
FROM debian:latest
RUN apt-get -y update && apt-get -y install lua5.1 lua-socket lua-sec
CMD [“lua”]
When I run the docker image, the error I keep getting is:
/bin/sh: 1: [“lua”]: not found
When I build it with:
CMD ["/usr/bin/lua"]
I then get this when I run it:
/bin/sh: 1: [“/usr/bin/lua”]: not found
What am I doing wrong?
Environment: Linux Mint 17 Cinnamon.
This error is displayed:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
when attempting the following in a virtualenv:
pip install lxml
pip install pillow
pip install pycrypto
pip install pymongo (fails but still shows in pip freeze)
There are several solutions here that recommend installing python2.7-dev:
Installing Pillow error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Installing lxml in virtualenv via pip install error: command 'x86_64-linux-gnu-gcc' failed
Pillow installation error: command 'gcc' failed with exit status 1
fatal error: Python.h: No such file or directory
I am confused by this recommendation however because it is my understanding that using something like:
sudo apt-get install python2.7-dev
would add this to the main *system* instance of Python, rather that the one in virtualenv. (see - https://unix.stackexchange.com/a/56392/92486)
Can I add python2.7-dev just to the virtualenv version of Python?
Most of the time these are dependency-issues.
Following the stack-trace of the gcc compiler one can see the missing files. Sometimes installing the Python development packages is not enough.
For example:
I tried to do pip install requests[security] in my virtualenv foo. This is the result that the pip-installer gave me.
Failed building wheel for cryptography
Running setup.py bdist_wheel for cffi
Stored in directory: /root/.cache/pip/wheels/99/e7/9a/68b1c8ca6f6f92b5feebd4d9434f50712b84f6a66d1285ea21
Successfully built cffi
Failed to build cryptography
Installing collected packages: cffi, cryptography, pyOpenSSL, ndg-httpsclient, requests
Running setup.py install for cryptography
Complete output from command /opt/foo/django-cms-virtualenv/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-eZaLAG/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-BwgYTp-record/install-record.txt --single-version-externally-managed --compile --install-headers /opt/foo/django-cms-virtualenv/include/site/python2.7/cryptography:
running install
running build
running build_py
running egg_info
writing requirements to src/cryptography.egg-info/requires.txt
writing src/cryptography.egg-info/PKG-INFO
writing top-level names to src/cryptography.egg-info/top_level.txt
writing dependency_links to src/cryptography.egg-info/dependency_links.txt
writing entry points to src/cryptography.egg-info/entry_points.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'docs/_build'
warning: no previously-included files matching '*' found under directory 'vectors'
writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
running build_ext
building '_Cryptography_cffi_a269d620xd5c405b7' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c -o build/temp.linux-x86_64-2.7/src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.o
src/cryptography/hazmat/bindings/__pycache__/_Cryptography_cffi_a269d620xd5c405b7.c:217:25: fatal error: openssl/aes.h: Datei oder Verzeichnis nicht gefunden
#include <openssl/aes.h>
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
The important part is the: #include <openssl/aes.h>
The compiler makes pretty clear that it is demanding this file - but it is not there in the filesystem.
Knowing that, the only thing left to do is: install the needed libraries!
Find out which package is needed for your distribution:
e.g. for Ubuntu you can go to The Ubuntu Package Search Site and enter the missing file you are looking for. In this case "aes.h"
Install the needed packages using your distributions package management tool:
e.g. for Ubuntu:
aptitude install libssl-dev
Retry with pip in your virtualenv:
pip install requests[security]
I installed python2.7-dev via Synaptic Package Manager in Linux Mint 17.
I could then accomplish the following in virtualenv:
pip install pillow
pip install pycrypto
And then I installed libxml2-dev and libxslt1-dev via Synaptic and could accomplish the following:
pip install lxml
I also did this so that the pymongo install didn't have any errors:
pip uninstall pymongo
pip install pymongo # i defined the version i needed ie pip install pymongo==2.6.2
I'm still confused how this fixes the problem, because I thought virtualenv was an isolated environment. Any clarification about this appreciated.
Work for me :
Just install python2.7-dev first
sudo apt-get install python2.7-dev
In Ubuntu 16.04.1 this worked for me:
sudo apt-get install libxml2-dev libxslt1-dev python-dev
For me the installation of lxml was failing on compilation. I followed the instructions for installation of lxml and reduced the compiler optimizations:
sudo CFLAGS="-O0" pip install lxml
After doing this, the compile of lxml succeeded.
This can be a problem in the pip. To solve, try:
sudo apt-get remove python-pip
To install pip, securely download get-pip.py.
https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
The cffi library needs libffi-dev:
sudo apt-get install libffi libffi-dev
Easiest way is:
sudo apt-get build-dep python-imaging
and then
pip install pillow
This works for me, 12.04, python2.7.6 for package lxml
sudo pip install libxml2 libxml2-dev libxslt1-dev
sudo pip install lxml