mitmproxy not working in El Capitan 10.11.6 - mitmproxy

I used the following command to install mitmproxy rather than using pip
brew install mitmproxy
However when I try to run mitmproxy, I receive the below. What could be the cause for this? Does that mean I have 2 version of six and need to uninstall the outdated?
$ mitmproxy
Traceback (most recent call last):
File "/usr/local/bin/mitmproxy", line 7, in <module>
from mitmproxy.main import mitmproxy
File "/Library/Python/2.7/site-packages/mitmproxy/main.py", line 7, in <module>
from six.moves import _thread # PY3: We only need _thread.error, which is an alias of RuntimeError in 3.3+
ImportError: cannot import name _thread

Related

I'm getting an error importerror /lib/arm-linux-gnueabihf/libm.so.6 version glibc_2.29' not found what should I do?

While I run my python code in raspberry pi 3b+ I'm getting:
importerror /lib/arm-linux-gnueabihf/libm.so.6 version glibc_2.29' not
found
error what should I do?
#beginner
pi#raspberrypi:~/Desktop/Mirror-Interface-Auth/RaspberryPi-Module $ python3 main.py
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/firebase_admin/firestore.py", line 22, in <module>
from google.cloud import firestore # pylint: disable=import-error,no-name-in-module
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore/__init__.py", line 18, in <module>
from google.cloud.firestore_v1 import __version__
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/__init__.py", line 30, in <module>
from google.cloud.firestore_v1._helpers import GeoPoint
File "/home/pi/.local/lib/python3.7/site-packages/google/cloud/firestore_v1/_helpers.py", line 22, in <module>
from google.api_core import gapic_v1
File "/home/pi/.local/lib/python3.7/site-packages/google/api_core/gapic_v1/__init__.py", line 16, in <module>
from google.api_core.gapic_v1 import config
File "/home/pi/.local/lib/python3.7/site-packages/google/api_
From this thread, it seems an older version must be installed to work.
sudo pip3 uninstall grpcio
sudo pip3 uninstall grpcio-status
Then
sudo pip3 install grpcio==1.44.0
sudo pip3 install grpcio-tools==1.44.0
After doing this my Raspberry Pi Zero W 2 does not fail upon importing the packages.

vtkCommonCorePython missing error in python3-paraview on Ubuntu 20

I'm trying to use paraview scripting within python3 for Ubuntu 20.04.1 LTS. If I open python3 on the command line I get the error
$> python3
Python 3.8.2 (default, Jul 16 2020, 14:00:26)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from paraview.simple import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/paraview/simple.py", line 41, in <module>
from paraview import servermanager
File "/usr/lib/python3/dist-packages/paraview/servermanager.py", line 56, in <module>
from paraview.modules.vtkPVServerImplementationCore import *
File "/usr/lib/python3/dist-packages/paraview/modules/vtkPVServerImplementationCore.py", line 2, in <module>
from . import vtkPVClientServerCoreCore
File "/usr/lib/python3/dist-packages/paraview/modules/vtkPVClientServerCoreCore.py", line 2, in <module>
from . import vtkPVCore
File "/usr/lib/python3/dist-packages/paraview/modules/vtkPVCore.py", line 2, in <module>
from . import vtkClientServer
File "/usr/lib/python3/dist-packages/paraview/modules/vtkClientServer.py", line 3, in <module>
from .vtkClientServerPython import *
ImportError: Failed to load vtkClientServerPython: No module named vtkmodules.vtkCommonCorePython
>>>
I have python3-paraview, paraview, paraview-dev, vtk7, python3-vtk7, etc installed from the synaptic installation manager. There are two files with vtkCommonCorePython inside the dist-packages directory :
/usr/lib/python3/dist-packages/vtk/vtkCommonCorePython.cpython-38-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/vtkmodules/vtkCommonCorePython.cpython-38-x86_64-linux-gnu.so
Searching the internet shows that other people have had similar problems, and solved it but including the paths to vtkCommonCorePython, but sys.path does include /usr/lib/python3/dist-packages, so vtkCommonCorePython should be found.
Can anybody see what might be missing in this case?
Many thanks! John
There are (or at least there were in previous versions) some slightly tricky conflicts between the vtk and paraview packages in python. I've found it's best to keep paraview for python in its own conda environment.
Assuming you have conda already, you should be able to get up and running with:
conda create -n paraview -c conda-forge paraview

conda pyqt import failed in a new virtual environment

I tried to run programs using pyqt.
It worked if I didn't use a virtual environment but if I activated a virtual environment, it would fail: ImportError: DLL load failed...
Traceback (most recent call last):
File "submitA2.py", line 14, in <module>
import matplotlib.pyplot as plt
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\pyplot.py", line 116, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\__init__.py", line 60, in pylab_setup
[backend_name], 0)
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\backend_qt5agg.py", line 16, in <module>
from .backend_qt5 import (
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\backend_qt5.py", line 18, in <module>
import matplotlib.backends.qt_editor.figureoptions as figureoptions
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\qt_editor\figureoptions.py", line 20, in <module>
import matplotlib.backends.qt_editor.formlayout as formlayout
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\qt_editor\formlayout.py", line 56, in <module>
from matplotlib.backends.qt_compat import QtGui, QtWidgets, QtCore
File "C:\Users\jerem\Anaconda3\envs\deep\lib\site-packages\matplotlib\backends\qt_compat.py", line 137, in <module>
from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: DLL load failed: The specified procedure could not be found.
I can't install another pyqt package in this virtual environment because it tells me:
# All requested packages already installed.
# packages in environment at C:\Users\jerem\Anaconda3\envs\deep:
#
pyqt 5.6.0 py36_4 conda-forge
How to fix this?? Thanks.
A not perfect solution: installing a different version of PyQt5 seems to get around this issue.
activate myenv
conda install pyqt=5.9
Jeremy Chen's solution is the only solution that worked for me. i.e
conda install pyqt=5.9 within your conda environment
All other solutinos listed on internet did not work.
But this installation of pytqt=5.9 breaks matplotlib module with the following error when trying
import matplotlib
ImportError: cannot import name 'get_backend'
This was solved by using
conda uninstall matplotlib
and then reinstalling
conda install matplotlib

Installing google-cloud-vision

I'm new to raspberry pi, google cloud, python, somewhat new to linux and would like a suggestion on how to fix/debug this problem. I'm getting an error when I install the Cloud Vision API Client Libraries for python.
It seems that this installation breaks pip and pip3 on raspian. Here's how I reproduced the problem from a fresh install of raspian:
pi#raspberrypi:~ $ pip --version
pip 1.5.6 from /usr/lib/python2.7/dist-packages (python 2.7)
pi#raspberrypi:~ $
pi#raspberrypi:~ $ sudo pip install --upgrade google-cloud-vision
...
...
At the end of the log:
Running setup.py install for dill
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/usr/local/lib/python2.7/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-1dbzT3/dill/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-lUJmAy-record/install-record.txt --single-version-externally-managed --compile:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 12, in <module>
import setuptools.version
File "/usr/local/lib/python2.7/dist-packages/setuptools/version.py", line 1, in <module>
import pkg_resources
File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 70, in <module>
import packaging.version
ImportError: No module named packaging.version
Afterwards, when I run pip, I get this:
pi#raspberrypi:~ $ pip --version
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 70, in <module>
import packaging.version
ImportError: No module named packaging.version
I'm not sure how to go about fixing this.
There's a trick to installing the cloud client libraries on Raspberry Pi: install virtualenv and sphinx first. The following steps will get you going:
sudo apt-get install python-pip virtualenv python-dev
virtualenv env
source env/bin/activate
pip install sphinx
pip install --upgrade google-cloud-vision
python

error while installing pyserial on beaglebone black with angstrom

I entered the following command to install pyserial on my beaglebone black - rev C with angstrom OS:
pip install pyserial
and I got the following error msgs:
Downloading/unpacking pyserial
Running setup.py egg_info for package pyserial
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pyserial/setup.py", line 23, in <module>
import serial
File "serial/__init__.py", line 10, in <module>
import importlib
ImportError: No module named importlib
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-root/pyserial/setup.py", line 23, in <module>
import serial
File "serial/__init__.py", line 10, in <module>
import importlib
ImportError: No module named importlib
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/pyserial
Storing complete log in /home/root/.pip/pip.log
Please how can I fix this.
Use the official Debian image from http://beagleboard.org/latest-images - the old Angstrom image has a broken Python build and hasn't been supported by BeagleBoard.org for a few years now.