Custom Search

Thursday, March 29, 2018

How to Upgrade Ubuntu 16.04 Server to 18.04 Server LTS

1)
$ sudo apt update
$ sudo apt upgrade

2)
$ sudo apt dist-upgrade
reboot (sudo init 6)




3)
$ sudo apt install update-manager-core

$ sudo vim /etc/update-manager/release-upgrades
set prompt=lts

4)
$ sudo do-release-upgrade -d

reboot (sudo init 6)

5)
$ lsb_release -a

Monday, March 19, 2018

src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found


1)

$ sudo python3 -m pip install pyaudio
The directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyaudio
  Downloading PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-pd32z5du/pyaudio/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-gvt8s7dv-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.6-intel-3.6
    copying src/pyaudio.py -> build/lib.macosx-10.6-intel-3.6
    running build_ext
    building '_portaudio' extension
    creating build/temp.macosx-10.6-intel-3.6
    creating build/temp.macosx-10.6-intel-3.6/src
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.6-intel-3.6/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^
    1 error generated.
    error: command '/usr/bin/clang' failed with exit status 1
    
    ----------------------------------------
Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-pd32z5du/pyaudio/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-gvt8s7dv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-pd32z5du/pyaudio/
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.



2)
$ brew install portaudio
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/portaudio-19.6.0.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring portaudio-19.6.0.sierra.bottle.tar.gz

🍺  /usr/local/Cellar/portaudio/19.6.0: 33 files, 452.7KB


3)
$ brew link portaudio
Warning: Already linked: /usr/local/Cellar/portaudio/19.6.0
To relink: brew unlink portaudio && brew link portaudio


4)
$ sudo python3 -m pip install pyaudio
The directory '/Users/user/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/user/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pyaudio
  Downloading PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... done
Successfully installed pyaudio-0.2.11
You are using pip version 9.0.1, however version 9.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

5)
$ python3
Python 3.6.1 (v3.6.1:69c0db5050, Mar 21 2017, 01:21:04) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyaudio
>>> 
>>> 

>>> quit()


Saturday, March 17, 2018

Python 3 How to Install and Uninstall Python Packages using PIP

Python 3 How to Install and Uninstall Python Packages using PIP
1)
python 3.6
sudo python3 -m pip install Django
sudo python3 -m pip show Django
sudo python3 -m pip uninstall Django

2)
python 2.7
sudo python -m pip install Django
sudo python -m pip show Django
sudo python -m pip uninstall Django

1)
sudo python -m pip install Django

$ sudo python -m pip show django
Name: Django
Version: 1.11.11
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: foundation@djangoproject.com
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: pytz

2)
sudo python3 -m pip install Django

$ sudo python3 -m pip show django
Name: Django
Version: 2.0.3
Summary: A high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Home-page: https://www.djangoproject.com/
Author: Django Software Foundation
Author-email: foundation@djangoproject.com
License: BSD
Location: /usr/local/lib/python3.6/dist-packages
Requires: pytz

How to Detect and Remove Python Packages Installed via Pip and Apt

How do I Detect and Remove Python Packages Installed via Pip and Apt Package Manager
1)
a)
install
$ sudo apt install python3-pil

b)
$ pip3 show Pillow
OR
$ sudo python3 -m pip show Pillow
Name: Pillow
Version: 5.0.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: aclark@aclark.net
License: Standard PIL License
Location: /usr/lib/python3/dist-packages
Requires:

c)
Uninstall
$sudo apt remove python3-pil

2)
a)
install
$ sudo python3 -m pip install Pillow

b)
$ pip3 show Pillow
OR
$ sudo python3 -m pip show Pillow
Name: Pillow
Version: 5.0.0
Summary: Python Imaging Library (Fork)
Home-page: https://python-pillow.org
Author: Alex Clark (Fork Author)
Author-email: aclark@aclark.net
License: Standard PIL License
Location: /usr/local/lib/python3.6/dist-packages
Requires:

c)
Uninstall
sudo python3 -m pip uninstall Pillow



Saturday, March 10, 2018

How to install Oracle Java JDK 9 in Ubuntu 18.04

0)
Download jdk9

http://www.oracle.com/technetwork/java/javase/downloads/index.html

http://www.oracle.com/technetwork/java/javase/downloads/jdk9-downloads-3848520.html

1)
java –version

2)
sudo mkdir -p /usr/lib/jvm/jdk9

3)
sudo mv jdk*/* /usr/lib/jvm/jdk9

4)
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk9/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk9/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk9/bin/javaws" 1

5)
java –version
javac –version

6)
sudo vim /etc/environment
JAVA_HOME="/usr/lib/jvm/jdk9"

7)
source /etc/environment

8)
echo $JAVA_HOME

9)
java –version
javac –version