Xubuntu 16.04: Can't add ppa after installing python3.6 and changing symlink - python

Recently I installed Anaconda with python3.6. Today I found that I couldn't add ppa repository because of python problem. The first problem was No module named 'apt_pkg'
When I run ~$ which python, I got /home/username/anaconda3/bin/python
I googled and found some ways to fix it. I tried to add alias python3=/home/username/anaconda3/bin/python at the end of my ~/.bashrc
It couldn't solve my problem, then I tried to create symlink by ~$ sudo ln -s /home/username/anaconda3/bin/python /usr/bin/python3
But that just give me another error. Now when I try to run ~$ sudo add-apt-repository ppa:nilarimogard/webupd8, I got
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
ModuleNotFoundError: No module named 'softwareproperties'
I'm using xubuntu 16.04 LTS and kinda new of it. Please suggest me how to fix this problem.


ModuleNotFoundError: No module named 'redis'

I tried to install redis-py lib via pip. It was installed successfully, but when I tried to import redis in python3 shell, I got the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'redis'
In python2 it gets imported with no errors.
I have tried all three pip, pip2, pip3 on my machine (ubuntu 17.10). Also I have python3.6 installed. I also tried easy_install
You are installing it in Python 2.7 (you have probably already know this). If python3.6 brings up the correct Python version on your system then this should work for you:
python3.6 -m pip install redis
If you are unsure what each pip version brings up you can use the which command to list the file path. This will give you a good indication as to where to look.
Also pip3.6 install redis might work but is not as secure as the above

Unable to continue Wagtail installation, “./migrate.py migrate” traceback

I'm installing Wagtail on Linode Ubuntu 16.04 LTS. I followed the following guides so far:
For the second link, I followed the installation guides for Python, pip, virtualenv and the required Pillow libs.
I got up to the following in the installation process:
$ pip install -r requirements.txt
$ ./manage.py migrate
The migrate command produces the following error:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
from django.core.management import execute_from_command_line
ImportError: No module named django.core.management
I haven't been able to find a solution for this. I am doing all of this in venv. Any help is greatly appreciated.
That error suggests that Django hasn't been installed.
What is the output of pip install -r requirements.txt?
I solved the issue by re-doing everything. Created new virtualenv, activated, and continued from there. Everything seems to be working correctly so far. Thanks!

ImportError: No module named 'appdirs'

I'm trying to get a program called hangoutsbot
to work on my linux server. I'm currently using a digital ocean server. However, every time I try to run the script it gives me an error that says:
ImportError: No module named 'appdirs'
I'm not sure what to do here. I've already tried installing appdirs from npm to no avail. This script works fine on my mac, however it doesn't seem to want to run on my linux server. Any help would be appreciated.
I ran across the same problem after solving the "missing pyparsing module" bug over here. I then started getting this error:
Traceback (most recent call last):
File "/usr/bin/pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 74, in <module>
import appdirs
ImportError: No module named appdirs
I then used the manual installation steps there to find the missing package on pypi.python.org and came up with this manual installation sequence:
wget https://pypi.python.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz
gunzip appdirs-1.4.3.tar.gz
tar -xvf appdirs-1.4.3.tar
cd appdirs-1.4.3
sudo python setup.py install
And that fixed it!
When you run hangoutsbot you'll need to specifically call the python version that has the modules installed. The following worked for me and I had python3.4 and python3.5 installed.
python3.5 hangoutsbot/hangoutsbot.py -d
I had this issue on Ubuntu 14.04 , which ships with a really old version of pip. I was using python 2.7. Upgrading to a newer version of pip with "pip install --upgrade pip" solved this issue for me. (I did this within my virtualenv, but could be needed at the system level depending on what you are trying to do.)
This was where I discovered the solution:

Python ImportError: No module named serial

I have installed Python 2.7.5 on Ubuntu 12.4 on a DELL LATITUDE E4300 64 bit and ran:
sudo pip install pyserial
nevertheless when running:
sudo python main.py
I receive the following error message:
Traceback (most recent call last):
File "main.py", line 4, in <module>
from mySerial import *
File "/home/oscar/ath10k/tools/sanity_test/src/mySerial.py", line 6, in <module>
import serial
ImportError: No module named serial
I looked on other posts but none of them helped me to solve this problem. I don't know what else to do I also ran:
sudo -H pip install pyserial
sudo pip install pyserial --upgrade
Any help will be greatly appreciated.
Kind regards.
Your script name is exactly like module name, change mySerial.py to something else.
I solved this by installing pyserial from source code instead than doing it with pip.
I do not know why it works this way and when using pip it prints error messages.
On my ubuntu 14.4 with python 2.7 as default, I installed pyserial for python3 (which my IDE is using actually) with the help of following command:
sudo apt-get install python3-serial

virtualenvwrapper installation error

I've installed pip and virtualenvwrapper through pip. I added the following lines to my .bashrc
# virutalenvwrapper
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv
source /usr/local/bin/virtualenvwrapper.sh
I'm getting an error once I source .bash_profile:
$ source ~/.bash_profile
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named virtualenvwrapper.hook_loader
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenv has been installed for
VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/2.7/bin/python and that PATH is
set properly.
What is this error? I've seen a lot of people with the same error and I've tried the suggestions listed and none seem to work with me.
I am running OS X Mountain Lion and Python 2.7.
run which virtualenv to see virtualenv's path