Categories
Mastering Development

I got ModuleNotFoundError: No module named ‘Cython’ when trying to make Extension

I’m trying to run this code : from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext ext_modules = [ Extension("sum", ["a123.pyx"])] setup( name = ‘app’, cmdclass = {‘build_ext’: build_ext}, ext_modules = ext_modules ) and I got this Error : Traceback (most recent call last): File "compile.py", line 3, in <module> from Cython.Distutils […]

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
Apple User Help

How to fix weird Python and urllib3 behavior with LMP USB-C gigabit ethernet adapter (connection aborted)?

I have this adapter for my Macbook Pro from 2019. I noticed something very strange that I’m debugging now since hours. I am using Ansible to create routes in Kubernetes and the following Ansible task works only if I am connected via Wifi but not when I am connect over the LMP adapter (I know, […]

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
Database Development

Recursively calling a function in PostgreSQL with language plpython3u

I am setting up a function where recursive action is relevant. The function basically maps two floats according to a rule and then returns a string. The code below is stripped for the actual function, but it should serve as a relevant code example (full code available). The original code (python 2.7) works fine, so […]

Categories
Mastering Development

Creating a subplot after adding plots using for loop

I have dataframe with an id column. I want to filter the dataframe for a specific id and then add data from columns to a plot (This part is done using a for loop). And finally, I want to add the plots (3 in this case) into a subplot. I have achieved it like this, […]

Categories
Mastering Development

python script in Nextflow

I’m trying to write python code in Nextflow script. error: Error executing process > ‘aln_sum (1)’ Caused by: Process aln_sum (1) terminated with an error exit status (1) Command executed: #!/usr/bin/env python fp = open(H1_IgG.vector.aln.metrics.txt) lines = fp.readlines() aln_sum = str(10000 / (int(lines[3].split(‘ ‘)[4]) + int(lines[4].split(‘ ‘)[4]))) print(aln_sum) Command exit status: 1 Command output: (empty) […]

Categories
Cryptocurrency Ethereum Mastering Development

Python w/ Brownie

Hi trying to install brownie w/ python using Jupyter getting the following errors: INFO: Could not find files for the given pattern(s). Traceback (most recent call last): File "c:\programdata\anaconda3\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\programdata\anaconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\maria\.local\bin\brownie.exe\__main__.py", line 4, in <module> File "c:\users\maria\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\__init__.py", line 6, […]

Categories
Mastering Development

Cannot import ttk in python tkinter

I am trying to import ttk from tkinter. I am following instructions from this website: I am using Spyder on mac with OS Mojave, on Spyder, python version is 3.8.6 (according to sys.version) My code is: import tkinter as tk from tkinter import ttk I am getting the following error message: runfile(‘/Users/Tom/untitled0.py’, wdir=’/Users/Tom’) Traceback (most […]

Categories
Mastering Development

how to fix error when importing geopandas in Spyder, possibly due to qgis install?

I run Ubuntu 18.04.5 LTS and use a virtualenv for Python (3.6.9) and use Spyder (3.6) as an IDE. I’ve set my Python interpreter on Spyder to point to this virtualenv and I’ve successfully used geopandas before with this setup. But now I am getting an import error when using Spyder. import geopandas as gpd […]