Categories
Linux Mastering Development Ubuntu

Not able to get mac address – Kali Linux

Here is the code that i am using to get mac address, it is working fine if i am getting mac address of ip= 10.0.2.1 but if i try to get mac address of 10.0.2.7, it is showing me list index out of bound exception, However i am using kali linux in virtual machine and […]

Categories
Linux Mastering Development Ubuntu

pip install pyopenssl object has no attribute ‘SSL_ST_INIT’

I’ve searched this forum for the same issues and none of the fixes worked for me. I have a Ubuntu 18.04 and any python 2.7 modules that need OpenSSL I get an attribute error. Pip install command always gives attribute error, but a pip freeze command works. I tried (unsuccessfully) the commands: pip install -U […]

Categories
Linux Mastering Development Ubuntu

Unable to locate package python3-distutils in Ubuntu 16.04

I am an Ubuntu noob and would like to ask you guys to help. Currently I’m faced with 2 issues. 1st issue is when I’m trying mkvirtualenv –python=/usr/bin/python3.8 ENV, it threw me this error. Error: RuntimeError: failed to query /usr/bin/python3.8 with code 1 err: ‘Traceback (most recent call last):\n File “/home/yao1122/.local/lib/python2.7/site- packages/virtualenv/discovery/py_info.py”, line 16, in […]

Categories
Linux Mastering Development Ubuntu

Unable to locate package python3-distutils in Ubuntu 16.04

I am ubuntu noob and would like ask you guys help. Currently i faced 2 issues. 1st issue is when i trying “mkvirtualenv –python=/usr/bin/python3.8 ENV”, it throw me this error. Error: RuntimeError: failed to query /usr/bin/python3.8 with code 1 err: ‘Traceback (most recent call last):\n File “/home/yao1122/.local/lib/python2.7/site-packages/virtualenv/discovery/py_info.py”, line 16, in \n from distutils.command.install import SCHEME_KEYS\nModuleNotFoundError: […]

Categories
Linux Mastering Development Ubuntu

Upgrade to Ubuntu 20 breaking mysqlclient pip package

Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File “/home/tom/cs344/group8-rw334-project-2/venv/lib/python3.7/site-packages/django/db/backends/mysql/base.py”, line 16, in <module> import MySQLdb as Database File “/home/tom/cs344/group8-rw334-project-2/venv/lib/python3.7/site-packages/MySQLdb/__init__.py”, line 18, in <module> from . import _mysql ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory The above exception was the direct cause of […]

Categories
Mastering Development

how to make assert output be logged to file?

How to send the all assert methods output to a log file using a logger? The output usually goes to std.err. Maybe it is necessary to create a handler, but I did not manage to do that. Here is the simple code example: #!/usr/bin/python3 import unittest import logging import logging.config # create logger logging.config.fileConfig(‘example.conf’) logger […]

Categories
Mastering Development

Python 2.7 won’t load any modules I installed. Will only load native modules that come with Python 2.7

Note: Please don’t comment here that Python 2.7 is depreciated. I already know this. I need to get this working first before migrating to 3.x. On Windows 10, I had installed (and running correctly) both Python 2.7 and Python 3.7. Since I only needed Python 2.7, I uninstalled Python 3.7 (and manually deleted respective packages […]

Categories
Linux Mastering Development Ubuntu

Error after the installation of python-pip

I have Ubuntu (version 18.04.4), installed on Windows, if it is important. Python version is 2.7.17. I’m installing pip with sudo apt install python-pip and the output looks ok, but when I’m trying even to check the version of pip by pip –version I got the following errors: Traceback (most recent call last): File “/usr/bin/pip”, […]

Categories
Mastering Development

Sending a basic packet with Python 3.9 using LibUSB1

I am developing some software in python 3.9 and I am at the point where I have a device connected to my USB port and would like to send a basic packet to test the interface before I proceed. I am using this example to try and get my interface to work. I am not […]

Categories
Mastering Development

Celery Worker command ‘method-wrapper’ object has no attribute ‘__module__’

Currently trying to initiate a worker for my django app, unfortunately i’m receiving this error: PS C:\Users\User\Documents\Codes\highlightreel> celery -A highlightreel worker -l info Traceback (most recent call last): File “c:\program files\python38\lib\runpy.py”, line 192, in _run_module_as_main return _run_code(code, main_globals, None, File “c:\program files\python38\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Program Files\Python38\Scripts\celery.exe\__main__.py”, line 7, in <module> […]