pyenv install 3.6.3 error occurring : why? - pyenv

user#syyun:~$ pyenv install 3.6.3
Downloading Python-3.6.3.tar.xz...
-> https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
Installing Python-3.6.3...
BUILD FAILED (Ubuntu 16.04 using python-build 1.1.5-8-g7b9d1a4)
Inspect or clean up the working tree at /tmp/python-build.20171020004725.32507
Results logged to /tmp/python-build.20171020004725.32507.log
Last 10 log lines:
ensurepip._main()
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 189, in _main
default_pip=args.default_pip,
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 102, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/tmp/python-build.20171020004725.32507/Python-3.6.3/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
Makefile:1079: recipe for target 'install' failed
make: *** [install] Error 1
Can't locate any related google-search record for above given error on pyenv install command.
Any guidance would be appreciate

This question is answered in the pyenv wiki. You have to prep your build environment first before trying to build a Python interpreter using pyenv.
According to the wiki, you need the following packages installed for Ubuntu:
apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev

Related

daq with error make: *** [Makefile:344: Makefile.in] Error 1

I learn about Snort and when I install it, I must install daq. When I implement./configure && make && sudo make install I see this warning:
cd . && /bin/bash /home/snort/snort_src/daq-2.0.7/missing automake-1.15 --foreign
/home/snort/snort_src/daq-2.0.7/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
http://www.gnu.org/software/automake
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
http://www.gnu.org/software/autoconf
http://www.gnu.org/software/m4/
http://www.perl.org/
make: *** [Makefile:344: Makefile.in] Error 1
I installed autoconf, automake 1.16.1, imlement autoreconf -f -i before but not succeed.
Someone can help me fix it?
Since your installing daq-2.0.7, I assume you are installing snort version ~2.9.And which version of linux/unix OS your testing installation with?
If your on Centos7.7, here a list of neccessary packages
yum update -y
yum install epel-release -y
yum install gcc gcc-c++ libnetfilter_queue libnetfilter_queue-devel git flex bison zlib zlib-devel pcre pcre-devel libdnet libdnet-devel tcpdump libnghttp2 wget xz-devel lzma -y
See snort documents for more details: https://www.snort.org/documents

Exception: Failed to attach BPF to kprobe when executing sudo opensnoop-bpfcc

When I try to execute sudo opensnoop-bpfcc I get this message:
In file included from /virtual/main.c:4:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:5:
In file included from include/linux/rculist.h:11:
In file included from include/linux/rcupdate.h:40:
In file included from include/linux/preempt.h:81:
In file included from ./arch/x86/include/asm/preempt.h:7:
In file included from include/linux/thread_info.h:38:
In file included from ./arch/x86/include/asm/thread_info.h:53:
./arch/x86/include/asm/cpufeature.h:150:2: warning: "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
[-W#warnings]
#warning "Compiler lacks ASM_GOTO support. Add -D __BPF_TRACING__ to your compiler arguments"
^
1 warning generated.
Traceback (most recent call last):
File "/usr/sbin/opensnoop-bpfcc", line 127, in <module>
b.attach_kprobe(event="sys_open", fn_name="trace_entry")
File "/usr/lib/python2.7/dist-packages/bcc/__init__.py", line 526, in attach_kprobe
raise Exception("Failed to attach BPF to kprobe")
Exception: Failed to attach BPF to kprobe
I don't understand how to fix it. I've just installed bcc tools using this command
sudo apt-get install bpfcc-tools linux-headers-$(uname -r)
as suggested on the github page https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary
The running OS is 18.04.2 LTS (Bionic Beaver).
I had to compile bcc from source code instead of installing it using the package.
Install linux kernel headers
sudo apt install linux-headers-$(uname -r)
Install required dependencies
sudo apt-get -y install bison build-essential cmake flex git libedit-dev \ libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev
Compile bcc from source code
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
#Maicake is right. Compiling and installing from source did work for me. Here are the steps to install on Ubuntu 22.04:
Follow the steps described here. Specifically for Ubuntu 22.04 you may need to make some changes after cloning the bcc repository.
Add the following line to your .bashrc file:
export PATH=$PATH:/usr/share/bcc/tools
Create a symlink to python3 as most of the tools use python (not python3) to run the scripts.
sudo ln -s /usr/bin/python3 /usr/bin/python

Error while installing Omnet++ on Ubuntu 16.04 : Cannot find osgEarth

I followed the installation guide and installed all the packages mentioned. However, I end up with this error message while running ./configure
checking for osgEarth with CFLAGS=" -fPIC -fno-stack-protector " LIBS=" -losgEarth -losgEarthUtil"... no
configure: error: Cannot find osgEarth 2.7 or later. Set WITH_OSGEARTH=no in configure.user to disable this feature or install an up to date version of osgEarth.
Here is a link to my config.log file : config.log
Cannot find osgEarth 2.7 or later
osgearth 2.7 for Ubuntu 16.04 → https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa →
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt update
sudo apt install libosgearth-dev // you get "2.7"
// All prerequisites :
sudo apt install g++ libxml2-dev libosgearth-dev bison flex clang swig libqt5opengl5-dev qt5-qmake openjdk-8-jre libopenmpi-dev tcl8.5-dev tk8.5-dev
Installing the libgeos-dev package, and then editing the configure.user file in my OMnet++ source directory solved my problem.
$ sudo apt-get install libgeos-dev
Change the line #OSGEARTH_LIBS= to this:
OSGEARTH_LIBS=" -losgEarth -losgEarthUtil -lgeos_c "
Make sure to remove the # in the beginning.
Now run:
$ . setenv
$ ./configure
And it should work..
Others have also faced this problem before and have the fix mentioned here solved their issues:
http://gmt.soest.hawaii.edu/boards/1/topics/4621
https://trac.osgeo.org/postgis/changeset/11363
Answered by Attila Török on the omnetpp google group (omnetpp#googlegroups.com)

Installing CKAN error - cannot determine reason

Here is a list of packages I had to install for CKAN 2.7.0
python-setuptools-36.2.4-4.mga7.noarch.rpm
pgdg-redhat96-9.6-3.noarch.rpm
xml-commons git subversion mercurial postgresql96-server postgresql96-devel postgresql96 python-devel libxslt libxslt-devel libxml2 libxml2-devel python-virtualenv gcc gcc-c++ make java-1.6.0-openjdk redis tomcat tomcat-webapps tomcat-admin-webapps xalan-j2unzip policycoreutils-python mod_wsgi httpd tcl-devel redis
after installing these tools i was able to download the git successfully using
pip install --ignore-installed -e git+https://github.com/okfn/ckan.git#ckan-2.7.0#egg=ckan
I then added pgsql-9.6 to the path in order for ckan to recognize pg_config
PATH=$PATH:/usr/pgsql-9.6/bin
Now when I attempt to run the requirements.txt installation it fails with this error
ImportError: No module named pytz
----------------------------------------
Cleaning up...
Command /usr/lib/ckan/default/bin/python -c "import setuptools;__file__='/usr/lib/ckan/default/build/pbr/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Aun2rR-record/install-record.txt --single-version-externally-managed --install-headers /usr/lib/ckan/default/include/site/python2.7 failed with error code 1 in /usr/lib/ckan/default/build/pbr
Storing complete log in /usr/lib/ckan/.pip/pip.log
If anybody can explain what the error means and what I need to install/modify I would greatly appreciate it. Seems there is a package called pytz missing but I cannot find information about it.
Thanks
pytz must must installed inside the virtualenv and the pip-requirements-docs.txt must be run prior to running requirements.txt.

Unable to install pip using python on unix

I'm trying to install pip module for python using the command python ./get-pip.py -v but it returns an error that zlib is not available:
[root#centos1 yum.repos.d]# python ./get-pip.py -v
Traceback (most recent call last):
File "./get-pip.py", line 19177, in <module>
main()
File "./get-pip.py", line 194, in main
bootstrap(tmpdir=tmpdir)
File "./get-pip.py", line 82, in bootstrap
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
When I tried to query for zlib, I see that it's already present:
[root#centos1 yum.repos.d]# rpm -qa | grep --color=auto -i 'zlib'
zlib-devel-1.2.3-7.el5
perl-Compress-Zlib-1.42-1.fc6
zlib-1.2.3-7.el5
perl-IO-Zlib-1.04-4.2.1
I tried installing zlib-devel, but still get the same error:
zipimport.ZipImportError: can't decompress data; zlib not available
How do I fix this and proceed in installing pip, as i've a need to proceed with the installation of awscli.
After installing "zlib" manually, after reinstall python again.
git clone https://github.com/madler/zlib.git
cd ${ZLIB_CLONED_DIR}
./configure --prefix=/usr/local
make
sudo make install
Rebuild the Python from source again
cd ${PYTHON_SRC_CODE_DIR}
./configure --prefix=${PYTHON_HOME_DIR}
make
sudo make install
the package python-pip is available in epel repo, install it by running yum install python-pip -y it will resolve any dependencies as well
after installing you can self update pip
pip install --upgrade pip then you can install awscli, pip install awscli