I am running "make setup" to install RediSearch on linux centos 7. The problem is:
make setup
Setting up system...
yum install -q -y ca-certificates
yum install -q -y curl wget
/usr/bin/python2 -m pip install --disable-pip-version-check wheel
/usr/bin/python2 -m pip install --disable-pip-version-check setuptools --upgrade
/home/andrewc/marcus/RediSearch/deps/readies/bin/enable-utf8
sed: -e expression #1, char 30: unterminated `s' command
In /home/bbbb/xxx/RediSearch/deps/readies/bin/enable-utf8:
command failed: { /home/bbbb/xxx/RediSearch/deps/readies/bin/enable-utf8; } >/tmp/tmpoqKXYK 2>&1
make: *** [Makefile:219: setup] Error 1
I have tried to reinstall Cmake but still failed to tackle the error
Running on an isolated environment (e.g., Docker container with a volume mount of your repo), you can setup and build RediSearch using:
./deps/readies/bin/getpy2
./sbin/system-setup.py
bash -l # enable toolchain
make
To diagnose the original issue, the following can be helpful:
./deps/readies/bin/getbashdb
bashdb ./deps/readies/bin/enable-utf8
Disabling enable-utf8 altogether in system-setup.py can also help, as lack of utf8 support typically causes problems only in CI systems.
Related
I was trying to dockerize a flask application with a third-party cli (plastimatch) on my M1.
I used ubuntu:18.04 as base image. The build on more recent version would fail with the error message 'no installation candidate was found'. The first odd thing I noticed was that the exact same build would succeed on a linux server.
I used a local venv to finalize the application and as I started to dockerize everything I got the following error:
#16 22.37 note: This error originates from a subprocess, and is likely not a problem with pip.
#16 22.37 ERROR: Failed building wheel for pylibjpeg-libjpeg
#16 22.37 Failed to build pylibjpeg-openjpeg pylibjpeg-libjpeg
#16 22.37 ERROR: Could not build wheels for pylibjpeg-openjpeg, pylibjpeg-libjpeg, which is required to install pyproject.toml-based projects
These python packages are wrappers for different C++ libaries, that handle images. The local build fails and the build on our linux server runs perfectly fine.
Has anyone noticed similar problems when dockerizing there applications locally in development? And are there any solutions to it?
Here is the reference of the used Dockerfile and requirements.txt (currently missing specific versions):
FROM ubuntu:18.04 as base
RUN apt-get update -y && apt-get install -y && apt-get upgrade -y
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y python3.8 python3-pip
RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.8 /usr/bin/python3
RUN apt-get install -y \
plastimatch \
zlib1g \
cmake
WORKDIR /app
COPY requirements.txt requirements.txt
RUN python3 -m pip install -U --force-reinstall pip
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install -r requirements.txt
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
FROM base as upload-dev
RUN echo "Building dev version"
COPY requirements_dev.txt requirements_dev.txt
RUN pip3 install -r requirements_dev.txt
COPY . .
python-dotenv
cython
pynrrd
flask-cors
Flask
Werkzeug
httplib2
numpy
pydicom
highdicom
dicomweb-client
Update: 01. July 2022
I could track down the error.
The problem was the missing wheel of some third party libraries. If no wheel could be located, the source code will be fetched and installed by a compiler. This crashed on my machine during the installation of libraries that use C++ at their core.
An easy approach to fix this problem would be to directly use the linux AMD64 image.
FROM --platform=linux/amd64 $YOUR_BASE_IMAGE
This would be a bit slower but for most development environments sufficient.
A detailed explanation: https://pythonspeed.com/articles/docker-build-problems-mac/
For me, the fix was to install Rosetta 2, which is included in the Docker documentation: https://docs.docker.com/desktop/mac/apple-silicon/#system-requirements
softwareupdate --install-rosetta
I'm trying to install Trino using RPM on Red Hat Enterprise Linux distribution. I install the Trino dependencies using the following commands:
$ sudo yum update -y
$ sudo yum install -y java-11-openjdk.x86_64 python3
$ sudo alternatives --set python /usr/bin/python3
Then I try to install Trino from archive in single-node mode. This however gives a dependency error:
$ sudo rpm -i trino-server-rpm-368.rpm
error: Failed dependencies:
python >= 2.4 is needed by trino-server-rpm-0:368-1.noarch
This error doesn't make sense to me given that this dependency is actually satisfied when checking my python version:
$ python -V
Python 3.6.8
An answers has been provided by #hashhar on this Github Issue if you actually have the correct dependencies installed:
$ sudo rpm -i --nodeps trino-server-rpm-368.rpm
I'm trying to install uswgi in a virutal env on linux ubuntu, python 3.5.2
I do
pip install uwsgi
I got this error
Failed building wheel for uwsgi
and at the end of the installing logs
*** uWSGI compiling embedded plugins ***
[thread 0][x86_64-linux-gnu-gcc -pthread] plugins/python/python_plugin.o
[thread 1][x86_64-linux-gnu-gcc -pthread] plugins/python/pyutils.o
In file included from plugins/python/python_plugin.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
In file included from plugins/python/pyutils.c:1:0:
plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory
compilation terminated.
----------------------------------------
Command "/home/ubuntu/envflask/env/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-wthov1ur/uwsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-quiupta5-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ubuntu/envflask/env/include/site/python3.5/uwsgi" failed with error code 1 in /tmp/pip-build-wthov1ur/uwsgi/
Linux 4.4.0-66-generic x86_64
Python 3.5.2
It is any solution for this? Thanks
You need to install Python3.5 development files, so run this command:
apt-get install python3.5-dev
The above command will install Python 3 headers to build uWSGI from source.
apt-get install build-essential python3-dev
From the uWSGI documentation:
uWSGI is a (big) C application, so you need a C compiler (like gcc or clang) and the Python development headers.
On a Debian-based distro an
apt-get install build-essential python-dev will be enough.
For Python3, just change that to python3-dev.
$ python3 --version
Python 3.5.2
$ pip3 freeze
uWSGI==2.0.15
For anyone with python 3.6 facing the same problem here is the step to solve it :
Get python 3.6 dev tools from this ppa:
sudo add-apt-repository ppa:deadsnakes/ppa
Then update your package list with :
sudo apt-get update
and then install your dev tools with 3.6 version
apt-get install build-essential python3.6-dev
Activate your virtual environment with and then install uwsgi:
pip install uwsgi
Debian have package depending on all supported Python 3 development packages:
apt-get install python3-all-dev
I have faced the same issue. I solve it by following:
sudo apt install libpython3.7-dev
If your python version is 3.6, then use 3.6 instead of 3.7.
After that install uwsgi using pip:
sudo pip install uwsgi
if you faced with the same problem while installing uwsgi under python3.6
just
apt-get install python3.6-dev
In my case uwsgi installed via buildout
NOTE: may be you should add valid ppa
Alternatively, you can use conda to install uwsgi, but make sure to use conda-forge channel:
conda install -c conda-forge uwsgi
You must install python3-devel package:
$ sudo dnf install python3-devel -y
And then install uwsgi module:
$ pip install uwsgi
I was stuck on this one, trying to install uwsgi on Unbuntu in Windows Linux Subsystem.
Although it didn't give permission error, I solved it by running:
sudo pip install uwsgi
For openSUSE (tumbleweed),
I deactivated and deleted my venv
installed python3-devel via yast2
then recreated and activated my venv
and pip install uwsgi
if you want to install uwsgi command, through
curl http://uwsgi.it/install | bash -s default /tmp/uwsgi
mv /tmp/uwsgi to /usr/local what ever
I had a similar issue when installing uwsgi
ibpython3.7m.a’ generated with LTO version 6.0 instead of the expected 8.1.
The default Python was 3.7 and I had to use pip3.8 to solve this problem.
However I have another problem. Running
sudo uwsgi --socket 0.0.0.0:5000 --protocol=http -w wsgi:app
generates the following error:
uwsgi: invalid option -- 'w'
getopt_long() error
I have tried many things, including modular installation
The main problem is that the default uwsgi folder is /usr/bin/uwsgi but when I install using pip3.8 it is not set to default. I couldn't resolve this problem and I switched to fastapi and uvicorn.
I'm still interested to find the solution to my problem.
I have Python 32 bits, I installed MySQL Community server 32 bits and I'm trying to install MySQLdb for Python.
I run
easy_install mysql-python
and I have this error
> easy_install mysql-python
Searching for mysql-python
Reading http://pypi.python.org/simple/mysql-python/
Reading http://sourceforge.net/projects/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.4b5
Downloading http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4b5.zip#md5=4f645ed23ea0f8848be77f25ffe94ade
Processing MySQL-python-1.2.4b5.zip
Running MySQL-python-1.2.4b5/setup.py -q bdist_egg --dist-dir /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/egg-dist-tmp-GjLaFB
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R
Now working in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R/distribute-0.6.28
Building a Distribute egg in /private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5
/private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/distribute-0.6.28-py2.6.egg
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1
Any idea on why gcc-4.0 cannot be found? I have Xcode and gcc 4.2.1 installed.
If you are on Mountain Lion ,Your problem seems to do with not having xcode command line tools installed, if you install them first from xcode then this should work
how to: pip install mysql-python on python 2.7
in order to >>>import MySQLdb
I FOLLOWED ALL THESE STEPS AND I GOT IT WORKING
For brew in case it wont let you update due to permissions.
chgrp -R admin /usr/local
chmod -R g+w /usr/local
chgrp -R admin /Library/Caches/Homebrew
chmod -R g+w /Library/Caches/Homebrew
brew update
brew doctor ## <--i did not use that
brew upgrade
ALSO I IGNORED THE Xcode update error
brew install mysql
pip install mysql-python
when i tried to import MySQLdb it threw me some errors so i followed the advise offered by the link bellow.
sudo ln -s /Users/$USERNAME/anaconda/lib/libssl.1.0.0.dylib /usr/lib/libssl.1.0.0.dylib
sudo ln -s /Users/$USERNAME/anaconda/lib/libcrypto.1.0.0.dylib /usr/lib/libcrypto.1.0.0.dylib
THE LINKS I USED
lib... issues
home bre update permission issue
install mysql with brew
I wanted to install eventlet on my system in order to have "Herd" for software deployment.. but the terminal is showing a gcc error:
root#agrover-OptiPlex-780:~# easy_install -U eventlet
Searching for eventlet
Reading http://pypi.python.org/simple/eventlet/
Reading http://wiki.secondlife.com/wiki/Eventlet
Reading http://eventlet.net
Best match: eventlet 0.9.16
Processing eventlet-0.9.16-py2.7.egg
eventlet 0.9.16 is already the active version in easy-install.pth
Using /usr/local/lib/python2.7/dist-packages/eventlet-0.9.16-py2.7.egg
Processing dependencies for eventlet
Searching for greenlet>=0.3
Reading http://pypi.python.org/simple/greenlet/
Reading https://github.com/python-greenlet/greenlet
Reading http://bitbucket.org/ambroff/greenlet
Best match: greenlet 0.3.4
Downloading http://pypi.python.org/packages/source/g/greenlet/greenlet- 0.3.4.zip#md5=530a69acebbb0d66eb5abd83523d8272
Processing greenlet-0.3.4.zip
Writing /tmp/easy_install-_aeHYm/greenlet-0.3.4/setup.cfg
Running greenlet-0.3.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-_aeHYm/greenlet-0.3.4/egg-dist-tmp-t9_gbW
In file included from greenlet.c:5:0:
greenlet.h:8:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1`
Why can't Python.h be found?
Your install is failing because you don't have the python development headers installed. You can do this through apt on ubuntu/debian with:
sudo apt-get install python-dev
for python3 use:
sudo apt-get install python3-dev
For eventlet you might also need the libevent libraries installed so if you get an error talking about that you can install libevent with:
sudo apt-get install libevent-dev
For Fedora:
sudo yum install python-devel
sudo yum install libevent-devel
and finally:
sudo easy_install gevent
What worked for me on CentOS was:
sudo yum -y install gcc
sudo yum install python-devel
For Redhat Versions(Centos 7) Use the below command to install Python Development Package
Python 2.7
sudo yum install python-dev
Python 3.4
sudo yum install python34-devel
Python 3.6
sudo yum install python36-devel
If the issue is still not resolved then try installing the below packages -
sudo yum install python-devel
sudo yum install openssl-devel
sudo yum install libffi-devel
On MacOS I had trouble installing fbprophet which requires pystan which requires gcc to compile. I would consistently get the same error: command 'gcc' failed with exit status 1
I think I fixed the problem for myself thus:
I used brew install gcc to install the newest version, which ended up being gcc-8
Then I made sure that when gcc ran it would use gcc-8 instead.
It either worked because I added alias gcc='gcc-8 in my .zshrc (same as .bashrc but for zsh), or because I ran export PATH=/usr/local/bin:$PATH (see comment)
Also: all my attempts were inside a virtual environment and I only succeeded by installing fbprophet globally (with pip), but still no success inside a venv
This is an old post but I just run to the same problem on AWS EC2 installing regex. This working perfectly for me
sudo yum -y install gcc
and next
sudo yum -y install gcc-c++
If it is still not working, you can try this
sudo apt-get install build-essential
in my case, it solved the problem.
try this :
sudo apt-get install libblas-dev libatlas-base-dev
I had a similar issue on Ubuntu 14.04. For me the following Ubuntu packages
On MacOS I also had problems trying to install fbprophet which had gcc as one of its dependencies.
After trying several steps as recommended by #Boris the command below from the Facebook Prophet project page worked for me in the end.
conda install -c conda-forge fbprophet
It installed all the needed dependencies for fbprophet. Make sure you have anaconda installed.
This page is gonna save your life, for all further lib issues that are forthcoming,
For Alpine(>=3.6), use
apk --update --upgrade add gcc musl-dev jpeg-dev zlib-dev libffi-dev cairo-dev pango-dev gdk-pixbuf-dev
For CentOS 7.2:
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
Install eventlet:
sudo yum install python-devel
sudo easy_install -ZU eventlet
Terminal info:
[root#localhost ~]# easy_install -ZU eventlet
Searching for eventlet
Reading http://pypi.python.org/simple/eventlet/
Best match: eventlet 0.19.0
Downloading https://pypi.python.org/packages/5a/e8/ac80f330a80c18113df0f4f872fb741974ad2179f8c2a5e3e45f40214cef/eventlet-0.19.0.tar.gz#md5=fde857181347d5b7b921541367a99204
Processing eventlet-0.19.0.tar.gz
Running eventlet-0.19.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-Hh9GQY/eventlet-0.19.0/egg-dist-tmp-rBFoAx
Adding eventlet 0.19.0 to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/eventlet-0.19.0-py2.6.egg
Processing dependencies for eventlet
Finished processing dependencies for eventlet
For openSUSE 42.1 Leap Linux use this
sudo zypper install python3-devel
I am using MacOS catalina 10.15.4. None of the posted solutions worked for me. What worked for me is:
>> xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
>> env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2==2.8.4
Collecting psycopg2==2.8.4
Using cached psycopg2-2.8.4.tar.gz (377 kB)
Installing collected packages: psycopg2
Attempting uninstall: psycopg2
Found existing installation: psycopg2 2.7.7
Uninstalling psycopg2-2.7.7:
Successfully uninstalled psycopg2-2.7.7
Running setup.py install for psycopg2 ... done
Successfully installed psycopg2-2.8.4
use pip3 for python3
if you are on Mac as myself, try this in your terminal: xcode-select --install
Then accept the installation request, and it works afterwards as described in this issue
Build from source and install, this is fixed in the latest release (10.3+):
mkdir -p /tmp/install/netifaces/
cd /tmp/install/netifaces && wget -O "netifaces-0.10.4.tar.gz" "https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e"
tar xvzf netifaces-0.10.4.tar.gz
cd netifaces-0.10.4 && python setup.py install
Similarly I fixed it like this (notice python34):
sudo yum install python34-devel
sudo apt install gcc
It works for PyCharm on Ubuntu 20.10.
If you are migrating to a more modern version of python3 e.g. python3.5 to python3.8 You may want to check/upgrade the versions of the library that are failing if you have already installed the recommended libraries to handle gcc building python3-dev + other libraries as suggested.
It depends on the package. Some versions of the packages may not be supported on later versions of python3.