Categories
Cryptocurrency Ethereum Mastering Development

web3 library has been renamed

when i run python 1_accounts.py I get the following error Traceback (most recent call last): File "1_accounts.py", line 2, in <module> from web3 import Web3 File "/home/esraa/.local/lib/python2.7/site-packages/web3/__init__.py", line 6, in <module> from web3.main import Web3 File "/home/esraa/.local/lib/python2.7/site-packages/web3/main.py", line 5, in <module> from web3.eth import Eth File "/home/esraa/.local/lib/python2.7/site-packages/web3/eth.py", line 18, in <module> from web3.utils.filters import ( […]

Categories
Mastering Development

Subprocess run works from Python, but not when using R and Reticulate

I have a command saved in a text file that I wish to execute using subprocess.run() from R using the reticulate package. I have a directory with three files: test_command.txt which contains the command touch foo.txt run_command.py: import subprocess import os subprocess.check_output(‘bash test_command.txt’) print(os.path.isfile("foo.txt")) # Check if the command was actually executed properly run_from_r.R: library(reticulate) […]

Categories
Linux Mastering Development Ubuntu

selenium.common.exceptions.WebDriverException: Message: invalid argument: can’t kill an exited process [closed]

This is my sample code to run the Firefox browser which i want to run in the centos 7. from selenium import webdriver browser = webdriver.Firefox() For the above code this is the error I’m facing, And my firefox version is Mozilla Firefox 68.10.0esr, and geckodriver version is geckodriver 0.26.0 (e9783a644016 2019-10-10 13:38 +0000). Traceback […]

Categories
Mastering Development

Creating instances of Inner classes

class studnt: def __init__(self,name,rno): self.name = name self.rno = rno self.laptop = self.laptop() def show(self): print(self.name,self.rno) self.laptop.show class laptop: def __init__(self,brand,cpu,ram): self.brand = "ASUS" self.cpu = 10 self.ram = 8 def show(self): print(self.brand,self.cpu,self.ram) s1 = studnt("rishabh",100) s2 = studnt("hanuman",1000) s1.show() I was learning classes in python and upon executing the code I get the following […]

Categories
Linux Mastering Development Ubuntu

Applications missing after “fsck”

I had an error on booting which left [initramfs] on the screen, after checking using another computer I ran the fsck as recommended, itallowed me to use the recovery mode on rebooting. However the Sofware updater, and others from the System menu will not run. I can update from the CLI. I read it might […]

Categories
Mastering Development

A strange import error while importing pandas from python3x

Python 3.6.9 (default, Apr 18 2020, 01:56:04) [GCC 8.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. import pandas Traceback (most recent call last): File "", line 1, in File "/home/suman/.local/lib/python3.6/site-packages/pandas/init.py", line 180, in import pandas.testing File "/home/suman/.local/lib/python3.6/site-packages/pandas/testing.py", line 5, in from pandas._testing import ( File "pandas/src/testing.pyx", line 4, in init pandas._testing […]

Categories
Mastering Development

I’m trying to preprocess a dataset for mimic2 but I’m officially stuck. Newbie alert

I’d like to preface by saying I am WAY in over my head working with datasets, machine learning, AI ,etc. Anyways.. Just downloaded some data sets from LJSpeech and I ran python3 preprocess.py –dataset ljspeech and I received this jumble Traceback (most recent call last): File "preprocess.py", line 5, in <module> from datasets import preprocessor […]

Categories
Mastering Development

An error when connect python code with Mysql using PyMysql

Dears, I’m working to connect python code with MysqlDB… But I get an error when I run the code below import cursor as cursor import pymysql.cursors # Connect to the database con = pymysql.connect(host=’127.0.0.1′, user=’root’, password=’123′, db=’db’, port=3306) request = (‘name’, ‘authorname’, ‘price’, ‘file’, ‘bookcover’, ‘description’) sql = (“INSERT INTO test” “(Bookname,Author,price,file,Bookcover,about)” “VALUES (%s, %s,%s, […]

Categories
Mastering Development System & Network

Having problems with timezone attribute on cron.yaml file in APP Engine Cron

I have a problem with the timezone attribute. It throws an error as below. "ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/xxxxxxx/cron.yaml] Unable to assign value ‘America/Santiago’ to attribute ‘timezone’: timezone ‘America/Santiago’ is unknown in "/xxxxxxx/cron.yaml", line 5, column 13" I did a test with other timezone values that have the same result. Current […]

Categories
Mastering Development

OSError: [WinError 193] %1 is not a valid Win32 application – nltk

So, I keep getting this error: OSError: [WinError 193] %1 is not a valid Win32 application I believed it to be because of my environment variables. So, I fixed that, but still keep getting the error. I’m at a loss currently. Here’s the complete error output: Traceback (most recent call last): File “c:\Users\angel\Desktop\Programming Related\Python\improvedTherapibot\copyImprovedBot.py”, line […]