Categories
Raspberry Pi User Help

import Spacy on RPI in Pycharm and other IDE gives error

I successfully installed Spacy using pip install spacy and alternatively through Pycharms virtual env, but when I import spacy in my program it’s giving me the following error; home/pi/.virtualenvs/cv/bin/python /home/pi/PycharmProjects/testSpeech/main.py Traceback (most recent call last): File "/home/pi/PycharmProjects/testSpeech/main.py", line 2, in <module> import spacy File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/spacy/__init__.py", line 10, in <module> from thinc.neural.util import prefer_gpu, require_gpu File […]

Categories
Raspberry Pi User Help

import Spacy on RPI in Pycharm and other IDE gives error

I successfully installed Spacy using pip install spacy and alternatively through Pycharms virtual env, but when I import spacy in my program it’s giving me the following error; home/pi/.virtualenvs/cv/bin/python /home/pi/PycharmProjects/testSpeech/main.py Traceback (most recent call last): File "/home/pi/PycharmProjects/testSpeech/main.py", line 2, in <module> import spacy File "/home/pi/.virtualenvs/cv/lib/python3.7/site-packages/spacy/__init__.py", line 10, in <module> from thinc.neural.util import prefer_gpu, require_gpu File […]

Categories
Cryptocurrency Ethereum Mastering Development

Why is allowance equal to zero?

I’m running this test: def test_mint(prf, exValue, web3): wBtcAddress = "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" ABI = [{"constant":True,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_token","type":"address"}],"name":"reclaimToken","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[],"name":"unpause","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"value","type":"uint256"}],"name":"burn","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[],"name":"claimOwnership","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[],"name":"finishMinting","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[],"name":"pause","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":False,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":False,"stateMutability":"nonpayable","type":"function"},{"constant":True,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":True,"inputs":[],"name":"pendingOwner","outputs":[{"name":"","type":"address"}],"payable":False,"stateMutability":"view","type":"function"},{"constant":False,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":False,"stateMutability":"nonpayable","type":"function"},{"anonymous":False,"inputs":[],"name":"Pause","type":"event"},{"anonymous":False,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"burner","type":"address"},{"indexed":False,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"to","type":"address"},{"indexed":False,"name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":False,"inputs":[],"name":"MintFinished","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"previousOwner","type":"address"},{"indexed":True,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"owner","type":"address"},{"indexed":True,"name":"spender","type":"address"},{"indexed":False,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":False,"inputs":[{"indexed":True,"name":"from","type":"address"},{"indexed":True,"name":"to","type":"address"},{"indexed":False,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}] wBTC = web3.eth.contract(address=wBtcAddress, abi=ABI) minter = accounts[0] god = accounts[1] wBTC.functions.approve(prf.address, exValue).transact({‘from’: str(minter)}) allowance = wBTC.functions.allowance(minter.address, web3.toChecksumAddress(prf.address)).call() assert allowance == exValue prf.mintNewPetRock(minter, "Fabio", 10**8).transact({‘from’: str(minter)}) assert prf.totalSupply().call() == 1 which throws this error: E brownie.exceptions.VirtualMachineError: revert: You need to check token […]

Categories
Ask Geographic Information System (GIS)

How to get Tkinter to work in pycharm using OSGeo4W64’s python

I apologize if this is an obvious question, but I have searched online and I have not been able to find an answer. I am creating an external qgis program that builds virtual rasters using the processing algorithm within qgis. I have this working, but it is not very convenient since you need to type […]

Categories
Mastering Development

parse json data to pandas column with missing quotes

I have a pandas dataframe "df". the dataframe has a field in it "json_field" that contains json data. I think it’s actually yaml format. I’m trying to parse the json values in to their own columns. I have example data below. when I run the code below I’m getting an error when it hits the […]

Categories
Mastering Development

Repeating a function inside a function in a class

I am a beginner how can I fix my problem which I want to repeat another function before it is called This is my code: class Banking: def __init__ (self): self.balance = 0 def intro (self): print (‘Welcome to Banking and services’) def deposit (self): dep = float (input (‘Enter amount to be deposited: ‘)) […]

Categories
Mastering Development

Unable to import airflow providers package

I am unable to import airflow providers package for Google. Command I used was pip3 install apache-airflow-backport-providers-google And it gives me the error ERROR: Could not find a version that satisfies the requirement apache-airflow-backport-providers-google (from versions: none) ERROR: No matching distribution found for apache-airflow-backport-providers-google Due to which my DAG is stuck and the error message […]

Categories
Mastering Development

Unable to upload to Azure blob asynchronously with python

I’m trying to upload images to azure blob storage and before uploading I’m checking with head request to make sure that file doesn’t exists. Code runs well but stops after sometime. I tried to close file but it is not working. Below is my code from azure.identity.aio import ClientSecretCredential from azure.storage.blob.aio import BlobClient from azure.core.exceptions […]

Categories
Linux Mastering Development Ubuntu

Installing pyipopt, encounter fatal error: IpStdCInterface.h: No such file or directory

This question is in the context of an attempt to install a library/interface on Ubuntu. It is a very specific problem, but any general help (such as in deciphering which script, or where in a particular script, the error is coming from) would also be greatly appreciated. I’m rather new to Ubuntu and this forum […]

Categories
Linux Mastering Development Ubuntu

Error reading cbr and cbz

I recently installed UbuntuStudio 19, upgarded to 20 I get strange error messages while trying to open cbr or cbz files. i’m sure the files are good beacause i can open them fine on windows and I could open them on Ubuntu and LinuxMint (previous installs). Also, I can unzip them fine and the images […]