How to install lxml on Amazon EC2 for Python 3.4 - amazon-ec2

After I finally got lxml installed on my computer by downloading the .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/, I thought my lxml installation problems were behind me. But, clearly I was very wrong. It does not seem to be any easier on the EC2 platform. I have tried just about every command I can think of—sudo pip3/pip3.4/pip-3.4/easy_install-3.4 lxml/lxml-3.5.0-cp34-none-win32.whl/lxml-3.5.0-cp34-none-win32.whl, STATIC_DEPS=true sudo pip3/pip3.4/pip-3.4/easyinstall-3.4 install lxml. I keep getting the Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed? error message.
I have tried to install these libraries too, but so far not successfully. Any help with installing either lxml or the dependent libraries would be greatly appreciated.

I was eventually able to install libxml2 by executing the following procedure:
Download the tar.gz. file from http://www.linuxfromscratch.org/blfs/view/7.7/general/libxml2.html, transfer it to the EC2 instance, and run tar -zxvf libxml2-2.9.2.tar.gz from the directory in which the file is located.
Run sudo yum install libxml2-devel libxslt-devel python34-devel. (The reason why I was unable to install these packages at first was that I used the omnipresent “-dev” wording, which did not work in this particular setup.)
From the libxml2-2.9.2 folder (as per the instructions at http://www.linuxfromscratch.org/blfs/view/7.7/general/libxml2.html) run
sed \
-e /xmlInitializeCatalog/d \
-e 's/((ent->checked =.*&&/(((ent->checked == 0) ||\
((ent->children == NULL) \&\& (ctxt->options \& XML_PARSE_NOENT))) \&\&/' \
-i parser.c
,
./configure --prefix=/usr --disable-static --with-history --with-python=/usr/bin/python3 && make
, and
make install
Then . . . , when I finally ran sudo easy_install-3.4 lxml, guess what . . . ; yes, the instance ran out of memory. So, I had to apply the following fix from How do you add swap to an EC2 instance?:
sudo /bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
sudo /sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
After that, it took quite a while to install using sudo easy_install-3.4 lxml, but it worked.

Related

protoc: command not found (Linux)

I am trying to use Protobuf on Linux box. I downloaded the pre-compiled from github.
When I try to compile my .proto file or just check the protobuf version, it says
protoc: command not found.
I tried the same steps on Windows machine using pre-compiled protobuf version and it works fine there.
Install protoc for Linux and Mac
Linux
PROTOC_ZIP=protoc-3.15.8-linux-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local include/*
rm -f $PROTOC_ZIP
Mac OS X
brew install protobuf
Alternately, if you don't have Homebrew.
PROTOC_ZIP=protoc-3.15.8-osx-x86_64.zip
curl -OL https://github.com/google/protobuf/releases/download/v3.15.8/$PROTOC_ZIP
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*'
rm -f $PROTOC_ZIP
source: http://google.github.io/proto-lens/installing-protoc.html
For Linux Ubuntu 20, only install with snap
snap install protobuf --classic
or via apt, with:
sudo apt install protobuf-compiler
You can try it:
Install grpc and protobuf
brew install grpc protobuf
I know this question is specifically asked for Linux and I could n't find any question as it relates to solving this error on Windows.
This might help people who encounter the same error on windows.
Step 1: Download the windows distribution (protoc-3.5.0-win32.zip) from the link protobuf and unzip locally to a folder
Step 2 : Add the folder path to the path in the system environment variables.
Step 3: close the command prompt, restart the command prompt and try the command protoc
I might be late to the party but I also had "command not found" when trying to run protoc. It turned out it was just missing the execute permission. A quick chmod +x protoc fixed this for me.

Trouble installing wget on Mac os

I'm trying to install wget-1.19.tar.xz.
What i did :
$ ./configure --with-ssl=openssl && make
$ sudo make install
Here the message error :
There seems to be no Makefile in this directory. You must run
./configure before running 'make'. make: ***
[abort-due-to-no-makefile] Error 1
Makefile.am and Makefile.in are in my directory.
Any ideas ?
I found this super useful guide that allows you to quickly install Rudix wget in less than 5 mins. Just installed it myself.
https://coolestguidesontheplanet.com/install-and-configure-wget-on-os-x/
For the easiest method, just go with the first option, download the package from the link(comes directly from Rudix)
rudix,org/packages/wget,html
Rudix offers wget for multiple supported Mac OS X versions
If you decide against installation with a .pkg, there are more options available along with full walk throughs of the installation process at the first link that I mentioned.
Hope this helps!
I too faced same,
I recommend installing wget via homebrew!, follow the below commands for smooth wget installation:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
Then you are good to go..

Julia in existing jupyter installation

I'm interested in hooking up julia to jupyter. I understand that in julia, Pkg.add("IJulia") would work - I've tried it, runs as expected.
However, that yields a new conda installation of jupyter, python etc. and blows up to > 2 GB (in addition to the 5xx MB of Julia itself). I already have a working jupyter installation with python and octave kernels up and running and was not looking to duplicate as much functionality.
How can I get a simplistic julia kernel connected to my jupyter?
If that is too silly a question, why is it much better the way it works out of the box? (Supplying me with search keywords is as appreciated as a more thorough answer)
[My guess is that building anew is trouble-free because it is a well-defined environment. I do however already have all that python and llvm and so on..]
Thanks & Best, Vincent
See the instructions at IJulia.jl for instructions on how to use your preexisting Jupyter installation.
However, be prepared for some packages, eg Interact.jl, not to work correctly, since they require specific combinations of packages. This is the reason why a Julia-local installation is now the default.
I have IJulia setup in JupyterHub (multi-user Jupyter notebook) in a Docker image at dclong/jupyterhub-julia. It's relatively simple.
FROM dclong/jupyterhub:18.10
RUN apt-get update \
&& apt-get install -y julia \
&& apt-get autoremove -y \
&& apt-get autoclean -y
# install IJulia
ENV JUPYTER=/usr/local/bin/jupyter
RUN julia -e 'empty!(DEPOT_PATH); push!(DEPOT_PATH, "/usr/share/julia"); using Pkg; Pkg.add("IJulia")' \
&& cp -r /root/.local/share/jupyter/kernels/julia-* /usr/local/share/jupyter/kernels/ \
&& chmod -R +rx /usr/share/julia/ \
&& chmod -R +rx /usr/local/share/jupyter/kernels/julia-*/

Janus WebRTC installation issue

I am installing Janus WebRTC Gateway in a Ubuntu Machine (14.04 64 bit). I followed the instructions as in the following link:
However, I get the following error when trying to execute janus:
https://github.com/meetecho/janus-gateway (readme.md file)
[FATAL] [janus.c:main:3670] No Janus API transport is available...
enable at least one and restart Janus
Anyone has any idea what the issue might be? I will only use the REST API without WebStockets or RabbitMQ.
I successfully installed Janus on Ubuntu 14 according to the following steps:
sudo apt-get install libmicrohttpd-dev libjansson-dev libnice-dev libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev libopus-dev libogg-dev libini-config-dev libcollection-dev libwebsockets-dev pkg-config gengetopt automake libtool doxygen graphviz git cmake
sudo apt-get install libavformat-dev
mkdir -p ~/build
cd ~/build
git clone git://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --disable-data-channels --disable-websockets --disable-rabbitmq --disable-docs --prefix=/opt/janus LDFLAGS="-L/usr/local/lib -Wl,-rpath=/usr/local/lib" CFLAGS="-I/usr/local/include"
make && sudo make install
sudo make configs
Running it by:
cd /opt/janus/bin/
./janus -F /opt/janus/etc/janus/
I had this issue before, I had write a script to install everything just run this
wget https://gist.githubusercontent.com/johnmelodyme/966f474a99b6dd0cf4e7ac19ba4258da/raw/0f1779499c62eeee3e2a577ef641e94e57b71154/janus.sh && sh janus.sh
Hope This Help Much, I believe there are certain dependencies needs to be installation but you missed it. In https://github.com/meetecho/janus-gateway it stated the Dependencies needed, have to be installed without error.
It is because libmicrohttpd version is lower than requirement, Download and install libmicrohttpd manually (dont use yum or apt-get).

Installing Apache on a mac (Lion) : "Did not find prce-config script at" error

I am trying to install Apache (by compilation)on my mac Lion.
Every time, I try to compile pcre, I get these two errors :
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
or
"Did not find prce-config script at"
I know I have this pcre-config file.
(I put http-2.4.1 and pcre-8.30 in Documents / Tried another location in MyUsername/Test/ >> same result >> it didn't work either).
Any help would be greatly appreciated.
Thanks.
Edit :
I copied http-2.4.1 and pcre-8.30 in "/"
then I cded to /pcre-8.30
then I issued ./configure >> Got no error.
then I cded /http-2.4.1
then I issued ./configure --prefix=/usr/local/apache_2.2. --with-pcre=/pcre-8.30
Got 1 error configure: error: Did not find pcre-config script at /pcre-8.30
I do not understand what "Install prefix .................. : /usr/local" means (in the pcre-8.30 configuration summary). I can't see any pcre file in this directory.
I got apache 2.4.1 to configure by doing the following (note i am running lion v 10.7.3)
I downloaded pcre and ran (Note: by default pcre will install into /usr/local)
$ ./configure
$ make
$ make install
setup httpd-2.4.1 with the following command
$./configure --prefix=/usr/local --with-pcre=/usr/local
$ make
$ make install
Test
$ usr/local/bin/apachectl start
This appeared to work for me hopefully it works for you
You can also install Homebrew from http://mxcl.github.com/homebrew/, and then
brew install pcre
It does not need root access.
And then run the ./configure.
Maybe you not install PCRE correctly. Please try this:
Install PCRE
Nginx requires PCRE – Perl Compatible Regular Expressions to build, I used PCRE version 8.13. In a Terminal, run:
sudo curl -OL h ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz > /usr/local/src/pcre-8.13.tar.gz
sudo mkdir -p /usr/local/src
cd /usr/local/src
tar xvzf pcre-8.13.tar.gz
cd pcre-8.13
./configure --prefix=/usr/local
make
sudo make install
cd ..
That is what I am trying...
I still couldn't get it to work using jfleong's answer. I came across fink, which you can download here http://www.finkproject.org/download/srcdist.php
After it was all installed, I ran:
$ fink install pcre
And then continued with installing apache and just using
$ ./configure
Without any flags. After I did all of that it finally was able to finish installing. Hope this helps!

Resources