Categories
Mastering Development

Long running celery worker task doesn’t return result even after success

I am running remote celery worker which takes around 2 hours to complete one task. Broker I have used is rabbitmq and for backend it is rpc. After completion of task, the celery worker doesn’t return result back to client. Celery version is 4.4 and OS is windows Can someone let me know what could […]

Categories
Mastering Development

Getting `TypeError: __new__() got an unexpected keyword argument ‘deny_new’ even though Discord.py is on 1.4.1

I’m trying to deploy a python bot to Discord via the heroku server, however I keep getting the TypeError: __new__() got an unexpected keyword argument ‘deny_new’ error when trying to deploy. Here are my full Heroku logs: 2020-08-16T20:25:13.659787+00:00 heroku[worker.1]: State changed from crashed to starting 2020-08-16T20:25:16.913818+00:00 heroku[worker.1]: Starting process with command `python3 bot.py` 2020-08-16T20:25:17.587024+00:00 heroku[worker.1]: […]

Categories
Mastering Development

How to split a text file into sentences for word2vec/gensim

I have extracted about 40MB of the English wikipedia into plain text. I would to use it to build a word2vec model with gensim. To do this I need to split it into sentences first. How can I do this? I tried: from __future__ import unicode_literals, print_function import spacy from spacy.lang.en import English nlp = […]

Categories
Mastering Development

AWS EB CLI pip error when pip install virtualenv

Exception: Traceback (most recent call last): File “c:\program files\python37\lib\site-packages\pip\_internal\cli\base_command.py”, line 179, in main status = self.run(options, args) File “c:\program files\python37\lib\site-packages\pip\_internal\commands\install.py”, line 315, in run resolver.resolve(requirement_set) File “c:\program files\python37\lib\site-packages\pip\_internal\resolve.py”, line 131, in resolve self._resolve_one(requirement_set, req) File “c:\program files\python37\lib\site-packages\pip\_internal\resolve.py”, line 294, in _resolve_one abstract_dist = self._get_abstract_dist_for(req_to_install) File “c:\program files\python37\lib\site-packages\pip\_internal\resolve.py”, line 242, in _get_abstract_dist_for self.require_hashes File “c:\program files\python37\lib\site-packages\pip\_internal\operations\prepare.py”, […]

Categories
Linux Mastering Development Ubuntu

python3.7: (Pyttsx3) No module named ‘pyttsx3’

I had a program (using module pyttsx3) written in Windows which I used to run on python3.7, and it used to run well. But,when I try to run it on Ubuntu 20.04, it doesn’t run. I have both python3.8.2 and python3.7.7 installed on my Ubuntu 20.04 PC, running the program with python3.8.2 interpreter gives the […]

Categories
Mastering Development

How to connect superset with mysql database?

I was trying to connect superset with mysql database with this SQLAlchemy URI:-mysql://localhost:3306/mysql/database/table1 but not able to connect. I was getting this error: ERROR: {“error”: “Connection failed!\n\nThe error message returned was:\nNo module named ‘MySQLdb’”, “stacktrace”: “Traceback (most recent call last):\n File \”/Users/akay/venv/lib/python3.7/site-packages/superset/views/core.py\”, line 1703, in testconn\n engine = database.get_sqla_engine(user_name=username)\n File \”/Users/akay/venv/lib/python3.7/site-packages/superset/utils/core.py\”, line 131, in call\n […]

Categories
Mastering Development

Inspite of installing tensorflow, `ModuleNotFoundError: No module named ‘tensorflow’` error occurs when I try to run files from CMD

I am tring to execute code from https://github.com/bhavandar/leaf-diseases-predition When I tried to execute the run.py file in cmd, I got the following error: Traceback (most recent call last): File “C:\Users\nmule\Downloads\leaf-diseases-predition\app\gui.py”, line 87, in Analyze self.hdf5Model() File “C:\Users\nmule\Downloads\leaf-diseases-predition\app\gui.py”, line 146, in hdf5Model text = self.hdf5Processing(4) File “C:\Users\nmule\Downloads\leaf-diseases-predition\app\progress.py”, line 53, in decorator raise exception File “C:\Users\nmule\Downloads\leaf-diseases-predition\app\progress.py”, line […]

Categories
Mastering Development

Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output – while installing auto-py-to-exe through pip

I am trying to download auto-py-to-exe on a different (windows) device than I usually use through pip. However when run I get the error (sorry it is so very very long): ERROR: Command errored out with exit status 1: command: ‘c:\users\tom\appdata\local\programs\python\python38-32\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-aplljhe0\\gevent\\setup.py'”‘”‘; __file__='”‘”‘C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-aplljhe0\\gevent\\setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ […]

Categories
Mastering Development

Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output – while installing auto-py-to-exe through pip

I am trying to download auto-py-to-exe on a different (windows) device than I usually use through pip. However when run I get the error (sorry it is so very very long): ERROR: Command errored out with exit status 1: command: ‘c:\users\tom\appdata\local\programs\python\python38-32\python.exe’ -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-aplljhe0\\gevent\\setup.py'”‘”‘; __file__='”‘”‘C:\\Users\\tom\\AppData\\Local\\Temp\\pip-install-aplljhe0\\gevent\\setup.py'”‘”‘;f=getattr(tokenize, ‘”‘”‘open'”‘”‘, open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close();exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ […]

Categories
Development

Installing cvxpy on windows with anaconda: failed nosetests misrebally

Please explain what I should do slowly. I am trying to install cvxpy on my machine. I have installed python, visual studio build tools and tried in command prompt but I got errors when I tried to install. So I ditched that idea and installed anaconda and I am now able to install and but […]