ImportError: cannot import name constants

I'm trying to run a simple piece of code using pyzmq. I am using Python 2.7 and pyzmq 14.5 $ python --version Python 2.7.6 $ sudo find /usr -name...

Interrupting Flask app in iPythonNotebook cause ZMQerror

I'm trying to run a most simple demo of flask app in an iPython notebook like this. from flask import Flask app = Flask(__name__) @app.route('/') def hello_world():. return 'Hello World!' if...

Python threading queue is very slow

I acquire samples (integers) at a very high rate (several kilo samples per seconds) in a thread and put() them in a threading.Queue. The main thread get()s the samples one by one into a list of...

one hot encoding for frequent values only

I am looking to do one hot encoding to a column, but only for those that are very frequent. All that are below a threshold T will be put in their own category. My strategy was to create a...

What is the difference between using ZMQ PUB with .connect() or .bind() methods?

In Python ZMQ publisher/subscriber sample template, the publisher uses .bind() method and the subscriber uses .connect() method, that connected to the bind IP address. But we can replace .bind()...

Installing MySQL-python causes command 'clang' failed with exit status 1 on Mac OS 10.13.15

I have installed tools via xcode-select --install but still show the following error while doing pip install MySQL-python Building wheels for collected packages: MySQL-python Running setup.py...

I can't install Jupyter and Matplotlib in my anaconda env

I have an environment of Anaconda (apart of root) and I'm trying to install this two libraries with no success. I tried: Install libraries by the environment tools of Anaconda Navigator...

Python: why do I get an error when I import geopandas?

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

Jupyter Notebook - Cannot Connect to Kernel

I've tried installing jupyter notebook using pip3 install jupyter. Every time i launch a new jupyter notebook, the notebook is unable to connect to the kernel. See screenshot below Attaching my...

WEBP support not installed error with Pillow included in Anaconda

I have written a small code to open webp image in the Anaconda prompt. from PIL import Image im = Image.open('test.webp') It causes the following...

Use zmq.Poller() to add timeout for my REQ/REP zmqclient, but the function does not return anything

I want to add a timeout for my 0MQ client. I tried zmq.Poller(). It seems to work at the beginning. But when I move code into a function, I find it doesn't return anything. It just stuck there. I...

Python ZMQ responder not receiving message

I am trying a simple zmq script but somehow the responder is not getting the first message. The Responder looks like this: def main(): context = zmq.Context() socket =...

"AssertionError: Torch not compiled with CUDA enabled" in spite upgrading to CUDA version

I figured out this is a popular question, but still I couldn't find a solution for that. I'm trying to run a simple repo Here which uses PyTorch. Although I just upgraded my Pytorch to the latest...

ImportError: cannot import name 'rcParams' from 'matplotlib'

I have tried to uninstall and reinstall matplotlib in my tf-gpu enviornment I made but I keep getting this error: ImportError: cannot import name 'rcParams' from 'matplotlib' This is the entire...

How to receive images from Raspberry Pi over ZeroMQ PUB/SUB in Python?

I want to send images taken by Picamera on Raspberry Pi to my windows computer. I wrote some code, as follows (they are simplified here), but it gets stuck in frame = footage_socket.recv_string()...

ZeroMQ: very high latency with PUSH/PULL

Summary I see very high latency at the receiver using `zmq.PUSH/PULL` sockets. Details I'm new to ZeroMQ, and am trying to send a few MBytes from the sender to the receiver (my final aim is to...

error while use '' pip install torch-geometric '' ,ERROR: Failed building wheel for llvmlite

error while use '' pip install torch-geometric '' ,ERROR: Failed building wheel for llvmlite Dependence: windows VS studio 2017 python 3.5.2 tensorboard 1.8.0 absl-py ...

module 'tensorflow' has no attribute 'Session' cannot resolve

Please please please help me out here! I cannot resolve it! so... my python version is Python 3.5.6 and Anaconda version is Conda 4.8.3. I am working with Jupyter Notebook. I am working in...

Multiprocessing memory leak, processes that stay around forever

I'm trying to solve a multiprocessing memory leak and am trying to fully understand where the problem is. My architecture is looking for the following: A main process that delegates tasks to a...

OANDA API Connection Error: TypeError in tpqoa.py package in __init__(self, conf_file)

I get the below error when attempting to establish a connection to my OANDA Practice account: api = tpqoa.tpqoa("oanda.cfg") TypeError Traceback (most recent call last) in ----> 1 api =...

How to make ZeroMQ use UDP?

I can't seem to be able to use UDP or find any examples of how to use it in PyZMQ. I want to be able to send a h264 stream. I was able to do that using TCP by using @nathancy answer on Python...

ImportError: Could not find the DLL(s) 'msvcp140.dll or msvcp140_1.dll'. Even when the files are located in the %PATH% directory

I receive the following error when importing tensorflow (base) PS C:\Users\Rostyslav\GIt\GNN-GCP> python run_model.py --train --save Traceback (most recent call last): File "run_model.py", line...

ModuleNotFound: dateutil.parser

Here's what I'm running into: (.venv) PS C:\Users\<redacted>\onedrive\dev\python\code\kb4> py kb4.py Traceback (most recent call last): File...

Cannot pip install mediapipe on Macos M1

Hello fellows I'm using mac air with M1 chip My env sets like (CV) san  ~/work/python  conda list # packages in environment at /Users/san/miniforge3/envs/CV: # # Name ...

Tensorflow Object Detection Api M1 Macbook Conflict Error

Machine: MacBook Air M1 2020 OS: macOs BigSur 11.4 Python version of venv: Python 3.8.6 Tensorflow version: ATF Apple Tensorflow 0.1a3 Pip version: 21.2.4 I have installed Tensorflow from...

Running cells with Python 3.10 requires ipykernel installed

I just installed Python 3.10 on my laptop (Ubuntu 20.04). Running a Jupyter Notebook inside of VS Code works with Python 3.9 but not with Python 3.10. I get the error message: Running cells with...

heroku failing to process requirements.txt "because these package versions have conflicting dependencies."

I have deployed this project many times before successfully and have made no changes to the requirements.txt file located in the root directory of the project, however. Heroku will no longer...

Python: matplotlib.pyplot.show() is not showing the plot

import matplotlib.pyplot as plt plt.plot([1,2,3]) plt.show() input("Press enter to continue...") If I run the script above within VS Code, or even within command prompt, the plot canvas only...

Getting DLL error when running tensorflow/keras program on python gpu 3.8

I am trying to run my simple AI program but I keep getting this DLL error: ImportError: Could not find the DLL(s) 'msvcp140_1.dll'. TensorFlow requires that these DLLs be installed in a...

pycharm error happening at random time: Process finished with exit code 134 (interrupted by signal 6: SIGABRT)

I am working with pycharm community on a tensorflow model with keras backend, sometimes this error appears in a random time, specially after I call pyplot and close the window: Exception ignored...