Not able to create site-package inside /usr/lib/Python2.7 it shows "Operation not permitted" - python-2.7

I was trying to install thrift(0.11.0) over my system(macOs 10.14.5).For which I downloaded and extracted tar file. Then I ran following commands :
./bootstrap.sh
./configure
make
make install
But make install throwed the following error :
error: could not create '/usr/lib/python2.7/site-packages': Operation not permitted
then I also tried manually creating site-package inside /usr/lib/python2.7 but still the error message was same.
I have also tried sudo while running make install but it didn't helped much.

1.open thrift's subfolder lib/py/ and modify the Makefile as follow:
PY_PREFIX=/usr
change to
PY_PREFIX = /Users/amy/python
2.sudo make install

I faced the same problem trying to install thrift on Mac OS.
I found a separate guide for installing thrift on Mac OS, I tried it and it finally worked successfully:
1- Download the boost library from boost.org untar compile with
./bootstrap.sh
sudo ./b2 threading=multi address-model=64 variant=release stage install
2- Download libevent, untar and compile with
./configure --prefix=/usr/local
make
sudo make install
3- Download the latest version of Apache Thrift, untar and compile with
./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
Try it and let me know your results.
Reference: Apache Thrift - OS X Install

Related

Google Cloud Build fails due to missing CMake

I am trying to deploy a Flask/ML app to Google Cloud but encountering this issue;
When I try to run gcloud builds submit --tag gcr.io/project-name/index with a requirements.txt file, it throws CMake must be installed to build dlib. Since now, I didn't have any problems working with dlib (I have cmake and build-essential already installed) and when I connect Google Cloud Shell via ssh, I can see both build-essential and cmake is installed and up to date on there too.
I tried to build on Ubuntu and Windows machines, same error consists.
Solved! CMake needs to be built in Dockerfile, not locally or in cloud shell.
Adding RUN apt-get update && apt-get -y install cmake before RUN pip install -r requirements.txt in Dockerfile resolved the issue.

Why is desired version of libboost-all-dev not found when building Docker container?

I'm trying to build a basic Docker container based on a tutorial. I am on Windows 10 Home version 2004, and I am using the standard command line. I've created the following Docker file to facilitate this, with the only change from the tutorial's version being my older version of gcc:
FROM gcc:6.3.0
RUN apt-get -qq update
RUN apt-get -qq upgrade
RUN apt-get -qq install cmake
RUN apt-get install libboost-all-dev=1.62.0.1
RUN apt-get -qq install build-essential libtcmalloc-minimal4 && \
ln -s /usr/lib/libtcmalloc_minimal.so.4 /usr/lib/libtcmalloc_minimal.so
Once the script gets to the step where it tries to install libboost-all-dev I get the following output:
Reading package lists...
Building dependency tree...
Reading state information...
E: Version '1.62.0.1' for 'libboost-all-dev' was not found
The command '/bin/sh -c apt-get install libboost-all-dev=1.62.0.1' returned a non-zero code: 100
and the build stops.
I've tried updating the build script to use the current version of Boost (1.74.0) as well and get the same issue. I'm not really finding any solutions in my research online and the output is not very helpful in trying to figure out what the issue is. Could anyone with more experience with installing Boost as part of the Docker process point me in the right direction?
The package manager will only be able to install versions of Boost that it knows exist, based on the enabled package manager repositories. There is typically only one version of Boost in the default repositories. In my experience, this applies to any Linux OS that supplies Boost, not only those that are run within a Docker container.
The Docker image you started with, gcc:6.3.0, appears to have only Boost version 1.55.0.2, so requesting any other version will yield the same error.
If you want a different version of Boost in your image, you can follow the typical steps for installing a different version of Boost outside a Docker container. These steps are well-documented on Stack Overflow, or you might find a repository such as this to enable in your package manager to directly install it from apt-get.

Cassandra C++ driver on MacOS High Sierra: make: no rule to make target

Following these instructions to install the DataStax C++ Driver on MacOS High Sierra, as a pre-requisite to installing the DataStax PHP Driver for Cassandra.
Everything runs great until I get to the line "make install" in the "Building and installing the C/C++ driver" section. That's where I get the message: "make: *** No rule to make target `install'. Stop."
Can someone help me get past this step?
** SOLVED ** a friend helped me stumble across the solution. Two things to remember when installing on MacOS High Sierra:
1.) You need to run the install of cpp-driver (which isn't a step in the DataStax instructions referenced in the question) and then
2.) You have to fully qualify the cmake .. command to point to the OpenSSL install.
Here are the amended instructions that worked for me:
# Datastax C++ driver dependencies
brew install libuv cmake
brew install openssl
brew link --force openssl
# Install git if you dont have it
brew install git
# Retrieve the cpp
git clone https://github.com/datastax/cpp-driver.git --depth=1
mkdir cpp-driver/build
cd cpp-driver/build
# Build with qualified path to OpenSSL location
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib ..
make
make install
# Install pecl driver
pecl install cassandra
Once that's complete you should be good to go.

Uninstall OpenCV 3.0.0 from Ubuntu14.04

I want to use surffeature with opencv3.0.0 on Ubuntu, but I didn't install opencv_contrib at first. When I tried to install opencv_contrib, it failed. So I intend to uninstall opencv3.0.0, and reinstall it with opencv_contrib. I just delete the build file which was built during the installing opencv3.0.0. Then I type :
make uninstall
in terminal. It failed again, the error information is :
CMake Error at cmake_uninstall.cmake:20 (MESSAGE): Problem when
removing "/usr/local/include/opencv2/cvconfig.h"
I found I should type :
make uninstall
instead of remove build file, but it's already done.
I installed opencv3.0.0 with the following instruction
sudo apt-get install build-essential
sudo apt-get install git libgtk2.0-dev libavcodec-dev libavformat-dev libtiff4-dev libswscale-dev libjasper-dev
sudo apt-get install pkg-config
cmake .
mkdir build
cd build
cmake -D WITH_IPP=OFF ..
make ..
sudo make install
cd /etc/ld.so.conf.d
sudo /bin/bash -c 'echo "/usr/local/lib" /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig -v
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
What should I do now ?
You have to use sudo, as the file belongs to the system and you don't have access to it by default.
Try:
sudo make uninstall
It worked for me.
I delete all the opencv files, including source file and installed file under /usr/local, finally re-install opencv

JSON support was not enabled-Modsecurity

1) I have compiled modsecurity using YAJL using --with-yajl but in the config log I see that the yajl library is not picked and in the modsecurity log I get
"JSON support was not enabled"
I initially had mod_security working with PHP 5.5 and Apache 2.4, with Ubuntu 12.04, but after enabling JSON request inspection I got the same error as you reported.
To fix it, I had to make yajl, re-compile mod_security with the yajl configure option, and then ensure that Apache was using the updated mod_security, and restart Apache.
mod_security was then able to successfully parse json request body and not output the error any longer.
I went to http://lloyd.github.io/yajl/ and found the download package for yajl-2.1.0, and then referred to https://gist.github.com/rpfilomeno/1140359f4bd360137a98.
For example:
tar -xvzf lloyd-yajl-2.1.0-0-ga0ecdde.tar.gz
cd lloyd-yajl-66cb08c/
sudo ./configure
sudo make
sudo make install
sudo ldconfig
That should install yajl. Then cd to the folder with the mod_security files, and run
cd ../modsecurity-2.9.1/
sudo ./configure --with-yajl="/usr/local/lib /usr/local"
sudo make
sudo make install
I then configured it to run with Apache 2.4, and have been able to parse requests with a JSON body.
*Note that when making yajl, if there is an error relating to cmake not being installed, run the following sudo apt-get install cmake, and then try making it again.
Check your config.log if it has following
checking for libyajl config script... no
checking for yajl install... no
configure: optional yajl library not found
Then create a link to yajl.pc as
# ln -s /usr/local/share/pkgconfig/yajl.pc /usr/share/pkgconfig/yajl.pc
In my case file yajl.pc was in /usr/local/share/pkgconfig/ location. If you cannot find it there try " find / -name yajl.pc " to locate it.
Hope this helps you.