Categories
Linux Mastering Development Ubuntu

pip3 not working in python3.8.2

I installed python 3.8.2 in my ubuntu OS which was preinstalled with python2.7 & python3.5 Using update-alternatives I was able to select the python version. Yet I am unable to install packages through pip. When I tried using pip after I selected 3.8 version to install some packages, I get the following error messages: Traceback […]

Categories
Mastering Development

Selenium not finding link element

I’m trying to click the “Login” button on this website, with Selenium : https://results.decisiondeskhq.com/2020/primary/colorado/president. I right clicked the element in inspect element, copied the xpath, and put it into the find_element_by_xpath function. Here’s my code: from selenium import webdriver driver = webdriver.Chrome(executable_path=”/users/aliallam/Desktop/scraper test/chromedriver”) url = ‘https://results.decisiondeskhq.com/2020/primary/colorado/president’ driver.get(url) driver.find_element_by_xpath(‘//*[@id=”content”]/div/div/div/div/button’).click() This is the error message I get: […]

Categories
Mastering Development

Flask RuntimeError: Working outside of request context

In my Flask app, I have a cookie being set in the following authorization context: project/ api/ routes/ spotify_auth.py spotify_auth.py from flask import Blueprint from flask import Flask, request, session, redirect spotify_auth_bp = Blueprint(‘spotify_auth’, __name__, template_folder=’templates’, static_url_path=’static’) @spotify_auth_bp.route(“/callback”, methods=[‘GET’, ‘POST’]) def spotify_callback(): session.clear() # Auth Step 4: Requests refresh and access tokens SPOTIFY_TOKEN_URL = “https://accounts.spotify.com/api/token” […]

Categories
Mastering Development

Calling python modules across multiple directories with one main script

I’m having some trouble accessing python modules across different directories.. My current directory looks something like this: __main__.py __test__.py tests some_tests.py _init__.py modules main_modules.py __init__.py where in some_tests.py I will call some methods from /modules, with test.py executing my testing modules in /tests I am using the below in some_tests.py to reference the modules in […]

Categories
Mastering Development

Is there any way to locate this button (if it is a button) and click on it?

I’m trying to click on some buttons of an online game. Taking a look at the game could be helpful. Is there any way to locate and click on the button with the text “1” (…</span>1</div>) in the following html (the game)? Here’s the specific html: <div class=”grid x5″ id=”grid”> <div style=”opacity: 1;”><span class=”box” style=”z-index:92″></span>1</div> […]

Categories
Mastering Development

I’m not able create virtual environment using virtualenv

C:\Users\NAVEEN\Desktop\Demo>virtualenv venv Traceback (most recent call last): File “c:\users\naveen\appdata\local\programs\python\python38\lib\runpy.py”, line 192, in _run_module_as_main return _run_code(code, main_globals, None, File “c:\users\naveen\appdata\local\programs\python\python38\lib\runpy.py”, line 85, in _run_code exec(code, run_globals) File “C:\Users\NAVEEN\AppData\Local\Programs\Python\Python38\Scripts\virtualenv.exe\__main__.py”, line 4, in <module> File “c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\__init__.py”, line 3, in <module> from .run import cli_run File “c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\run\__init__.py”, line 12, in <module> from .plugin.activators import ActivationSelector File “c:\users\naveen\appdata\local\programs\python\python38\lib\site-packages\virtualenv\run\plugin\activators.py”, line 6, […]

Categories
Linux Mastering Development Ubuntu

Target WSGI script ‘/var/www/FlaskApp/flaskapp.wsgi’ cannot be loaded as Python module

Stuck here for days mod_wsgi (pid=16615): Target WSGI script ‘/var/www/FlaskApp/flaskapp.wsgi’ cannot be loaded as Python module. mod_wsgi (pid=16615): Exception occurred processing WSGI script ‘/var/www/FlaskApp/flaskapp.wsgi’. Traceback (most recent call last): File “/var/www/FlaskApp/flaskapp.wsgi”, line 7, in <module> from FlaskApp import app as application File “/var/www/FlaskApp/FlaskApp/__init__.py”, line 6, in <module> from Recognition import testCode,trainCode File “/home/example_2019/Recognition.py”, line 2, […]

Categories
Development Linux Ubuntu

How to fix pip: RuntimeError: Python 3.5 or later is required

What i should reinstall to fix my python3 pip? It was ok until i pip-updated something. Ubuntu 14.04. $ pip3 search youtube-dl Traceback (most recent call last): File “/usr/local/bin/pip3”, line 7, in <module> from pip._internal.cli.main import main File “/usr/local/lib/python3.4/dist-packages/pip/_internal/cli/main.py”, line 10, in <module> from pip._internal.cli.autocompletion import autocomplete File “/usr/local/lib/python3.4/dist-packages/pip/_internal/cli/autocompletion.py”, line 9, in <module> from pip._internal.cli.main_parser […]

Categories
Development System & Network

pip/python error: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object

I’m trying to use certbot but it was giving me problems, so then I was told to reinstall it inside a virtual environment… I got virtualenv installed with pip, but then: > virtualenv -p /usr/bin/python2.7 certbot Traceback (most recent call last): File “/bin/virtualenv”, line 7, in <module> from virtualenv.__main__ import run_with_catch File “/usr/lib/python2.7/site-packages/virtualenv/__init__.py”, line 3, […]

Categories
Development Linux Ubuntu

Lutris broke, 1 week down the rabbit hole, pip refuses to run

My lutris install broke, and after a week down that rabbithole of errors, i have been halted. lutris spits out this error message Traceback (most recent call last): File “/usr/bin/lutris”, line 34, in <module> from lutris.gui.application import Application File “/usr/lib/python3/dist-packages/lutris/gui/application.py”, line 34, in <module> from lutris.game import Game File “/usr/lib/python3/dist-packages/lutris/game.py”, line 11, in <module> from […]