Install python3-networkx on Debian wheezy - python

I try to get a script running, which needs python3 and networkx
python3-networkx is not in the apt-repository, so I installed it using:
apt-get install python-networkx
But still my script crashed saying networkx is not found.
How can I install the python3 version?

For installing packges in Debian, you may run:
sudo apt-get update
sudo apt-cache search networkx
Which shows this:
python-networkx - tool to create, manipulate and study complex networks
python-networkx-doc - tool to create, manipulate and study complex networks - documentation
python3-networkx - tool to create, manipulate and study complex networks (Python3)
Then you can run:
sudo apt-get install python-networkx
Alternatively, you can use pip:
sudo apt-get update
sudo apt-get install python-pip
sudo pip install networkx
I have tried this in jessie and it worked with python 2.7.
For installing python3 you can use:
sudo apt-get update
sudo apt-get install python3 python3-pip
and for installing networkx:
In Debian jessie:
sudo pip3 install networkx
In Debian Wheezy:
sudo pip-3.2 networkx
You can check more info about apt-get here or man apt-get in linux terminal.
Also you can check pip documentation here.

Related

Installing python 3.9 on Cloudera CDSW without sudo

I am trying to install Python 3.9 on Linux 4.4 in Cloudera Data Science Workbench (cdsw).. I do not have sudo rights and I wont be able to connect to any websites.
The current version of python is 3.6
Following the procedure as mentioned here.
However, on step "sudo make altinstall" I get the error "permission denied" on /usr/local/bin
Is there any workaround to make this step work?
This is the last step of the whole procedure.
You can use the method on top and install using apt... It's the best way to do it,
sudo apt update
sudo apt install software-properties-common
Followed by adding the repository,
sudo add-apt-repository ppa:deadsnakes/ppa
Accept the changes, then
sudo apt install python3.9
Now, whenever you want to use python3.9 you have to invoke python3.9 instead of python3.
If you are using cloudera, cdsw, you cannot get sudo rights, you need to follow this guide to install packages,
https://docs.cloudera.com/documentation/data-science-workbench/1-8-x/topics/cdsw_extensible_engines.html
Follow the guide above, then change the docker file like this
# Dockerfile
FROM docker.repository.cloudera.com/cdsw/engine:8
RUN rm /etc/apt/sources.list.d/*
RUN apt-get update
RUN apt install software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install python3.9 python3-pip \
&& rm /etc/apt/sources.list.d/*
RUN pip install pandas numpy
Then follow the rest of the guide for steps 2-4, you should be able to get your desired outcome.

Install PCL Library on Python/Ubuntu 18.04 LTS

How do you install PCL Library on Python/Ubuntu 18.04 LTS?
I've tried different ways to do so, without luck.
Trying to import pcl results in:
ImportError: libpcl_keypoints.so.1.7: cannot open shared object file: No such file or directory
Install it as a system-wide library, versus a Python module.
sudo add-apt-repository ppa:sweptlaser/python3-pcl
sudo apt update
sudo apt install python3-pcl
from here
I tried much to solve this issue. The drawback is here:
sudo apt-get install libpcl-dev -y
If you run this, it will install libpcl-dev with a higher version which will be conflicted with that libpcl-dev 1.7 you will install later. Here are some steps to raise the issue:
initially add Ubuntu 16 source list
then run below lines one by one.
sudo apt-get update
pip install python-pcl
sudo apt-get install libpcl-keypoints1.7
sudo apt-get install libpcl-outofcore1.7
sudo apt-get install libpcl-people1.7
sudo apt-get install libpcl-recognition1.7
sudo apt-get install libpcl-registration1.7
sudo apt-get install libpcl-segmentation1.7
sudo apt-get install libpcl-surface1.7
Now, if you get error "libpng12-0", do this:
sudo add-apt-repository ppa:linuxuprising/libpng12
sudo apt update
sudo apt-get install libpng12-0
sudo apt-get install libpcl-tracking1.7
sudo apt-get install libflann1.8
sudo apt-get install libpcl-visualization1.7
finally,
python
>>> import pcl
Congratulation : PCL is successfully imported

h5py import error on libhdf5_serial.so.100

I have installed raspbian os on raspberry pi 3 model b. I have to perform a project which involves use of h5py.
The os already came preinstalled with python 2.7 and 3.5
With the help of pip, I installed h5py and it was successful, for python 3.5.
ImportError: libhdf5_serial.so.100: cannot open shared object file: No such file or directory
I don't know how to proceed with this error, can somebody please point out an appropriate way to handle this error?
I met the same question as yours, and you can use the website below to solve it: https://www.howtoinstall.co/en/debian/stretch/
In generally, you will find these commands similarly.
sudo apt-get update
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-serial-dev
Besides, you can visit my blog about this problem. It's written in Chinese, so maybe you need http://translate.google.com
Install all of these packages
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libcblas-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
https://stackoverflow.com/a/53402396/2696230

pyconfig.h missing during "pip install cryptography"

I wanna set up scrapy cluster follow this link scrapy-cluster,Everything is ok before I run this command:
pip install -r requirements.txt
The requirements.txt looks like:
cffi==1.2.1
characteristic==14.3.0
ConcurrentLogHandler>=0.9.1
cryptography==0.9.1
...
I guess the above command means to install packages in requirements.txt.But I don't want it to specify the version,So I change it to this:
cat requirements.txt | while read line; do pip install ${line%%[>=]*} --user;done
When install cryptography,it gives me the error:
build/temp.linux-x86_64-2.7/_openssl.c:12:24:fatal error:pyconfig.h:No such file or directory
#include <pyconfig.h>
I don't know how to solved this , I have tried a lot of methods ,but failed. my system is centos 7, and the version of python is 2.7.5(default).
Besides, Is there any other scrapy frame which is appliable for a large number of urls . Thanks in advance
For Ubuntu, python2
apt-get install python-dev
For Ubuntu, python3
apt-get install python3-dev
I have solved it by myself. for the default python of centos, there is only a file named pyconfg-64.h in usr/include/python2.7/,So run the command
yum install python-devel
Then it works.
for python3.6,
apt-get install python3.6-dev
and
apt-get install libssl-dev libffi-dev
i use python 2 on ubuntu and got the same problem when installing cryptography.
after i run this command
apt-get install python-dev libssl-dev libffi-dev
then it works.
For Python 3.7 on Debian, the following works for me.
apt-get install python3.7-dev
and
apt-get install libssl-dev
You may also need:
apt-get install libffi-dev
On a Debian based distro (AntiX distro), together with apt-get install python3-dev, I also installed rust, to complete successfully the pip3 install cryptography command. So, I gave:
$ sudo apt-get install build-essential curl python3-dev libssl-dev libffi-dev
$ sudo curl https://sh.rustup.rs -sSf | sh
When prompted (Figure 1), type 1 and hit Enter on your keyboard.
Once it completes, you have to give following commands:
$ source $HOME/.cargo/env
$ source ~/.profile
$ pip3 install cryptography

How to prepare Ubuntu 14.04 for installing Django

I came across a tutorial which lists a number of libraries to install before installing Django (I am using Ubuntu 14.04, Python3, and Django 1.8):
$ sudo apt-get update
$ sudo apt-get -y upgrade
$ sudo apt-get install -y build-essential
$ sudo apt-get install python-setuptools python-dev python3.4-dev python-software-properties libpq-dev
$ sudo apt-get install libtiff4-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.5-dev tk8.5-dev
$ sudo apt-get build-dep python-imaging
But other tutorials may not list so many libraries to install. I wonder which are absolutely necessary, and others may be omitted?
You only need to install these dependencies if you want image processing via pillow and if you plan on installing it via pip (the Python package manager) rather than apt-get (Ubuntu's package manager).
Since you're using a virtualenv, you will need to install this package from source. The following commands will get the build dependencies and install pillow using pip.
$ sudo apt-get build-dep python3-imaging
$ pip install pillow
Note that pillow is a beast to compile. Be prepared to wait several minutes.

Categories