Categories
Mastering Development

mysql.connector issue with System Error : 32 Broken Pipe

I’m using library discord.py and i have issue with mysql.connector. I use mariadb database for server prefixes but when my bot runs 24/7, it starts throwing these errors 0|PyBot | File "/home/pi/.local/lib/python3.7/site-packages/discord/utils.py", line 329, in maybe_coroutine 0|PyBot | value = f(*args, **kwargs) 0|PyBot | File "/home/pi/PyBotV2/bot/main.py", line 11, in get_prefix 0|PyBot | return fetch_prefix(message.guild.id) 0|PyBot […]

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
Raspberry Pi User Help

undefined symbol: libusb_free_config_descriptor

I try to use a Chafon UHF RFID reader via USB with Pi Zero. I did everything from the user guide, but get these messages. What would be the problem, and how can I solve it? I’ve already tried it on Mac, too, but got a similar errors. Please help, thank you so much -bash-5.0$ […]

Categories
Mastering Development

Python: module lost from scope in code block passed to exec(…)

Calling the imported function helpers.test_func(…) succeeds when called directly in the code block. But fails with this exception: File "<string>", line 11, in <module> File "<string>", line 8, in z NameError: name ‘helpers’ is not defined when called indirectly, via the function z(), also defined in the block code = """ from my_proj import helpers […]

Categories
Mastering Development

How can I fix a RuntimeError in Python for a discord bot?

I’ve been trying to build myself a discord bot based on a tutorial series that I’m watching. When i try to run the code below, I get a Runtime Error. I left the Token that you need to connect to with the bot out in the last line because I obviously don’t want any one […]

Categories
Linux Mastering Development Ubuntu

How can I solve “no module named ‘_lzma'”?

I am trying to run the BoltzTraP2 software installed in Ubuntu 20.04.1 LTS but I get this error. Kindly let me know how I can solve this. I have installed pandas and liblzma-dev, still I get the error. ========================================================== you can install pyfftw to get better FFT performance Traceback (most recent call last): File "/home/syl2/.local/bin/btp2", […]

Categories
Mastering Development

How to get pexpect.expect() to recognize a blank prompt?

I am trying to automate some calculations done by the computational chemistry program GROMACS. I am using pexpect to spawn GROMACS (gmx). I parse the output to find the keyword I want and then I want pexpect to send the number associated with that keyword: import sys import pexpect def call_gmx(inFile, outFile, keyword): gmx = […]

Categories
Ask Geographic Information System (GIS)

ArcGIS 10.5 ImportError: cannot import name multiarray with numpy

I’ve installed ArcGIS 10.5, and with it the numpy 1.9.3 library. However, I get the following error when I try to run any scripts with numpy: Traceback (most recent call last): File "U:\vickerss\TestNumpy.py", line 1, in import numpy File "C:\Python27\ArcGIS10.5\lib\site-packages\numpy_init_.py", line 170, in from . import add_newdocs File "C:\Python27\ArcGIS10.5\lib\site-packages\numpy\add_newdocs.py", line 13, in <module> from numpy.lib […]

Categories
Mastering Development

Assertion error when inheriting multiprocessing.Process

I needed a separate process that would open some files on initialization and close them gently at the end. For this, I inherited a class from Process. Here is a minimal demo: from multiprocessing import Process from multiprocessing.process import BaseProcess class Proxy(Process): def __init__(self): super().__init__(self) def run(self): pass if __name__ == "__main__": proxy = Proxy() […]