Occasional ctypes error importing numpy from mod_wsgi django app

Here's the setup: Django (1.2) app on mod_wsgi that imports ctypes Python 2.6.5 Apache 2.2.3 SELinux disabled RedHat EL 5 64bit some of the file system is mounted over nfs Occasionally, when I...

How to solve a generalized eigenvalue Problem for multiprecision in Python

I want to solve a generalized eigenvalue problem for multiprecision in Python ( A.C = (lam).B.C where A and B are 3000x3000 matrices and C is 3000x1 vector. (lam) is the eigenvalue.). So I have...

Does sympy/mpmath cache results and what speed implications would that have?

I performed the following calculation: from sympy import mpmath as mp mp.besseljzero(1000, 100) which understandably took some time > 10s if not more (didn't time it). Subsequent calls were...

BBP-Algorithm in Python - Working with Arbitrary-precision arithmetic

I am writing on a term paper about the calculation of pi. While i have finished the theoretical site, i`m now struggeling implementing the BBP-Algorithm in Python. You can find the BBP-Algorithm...

np.roots() causing 'float() argument must be a string or a number' with mp.mpc type problems

I was getting this error: > float() argument must be a string or a number So, why does this happen?(I tried commands like np.asarray() but it keeps failing). mp.mpc(cmath.rect(a,b)))

Flask python app crashes on heroku

I tried pushing my code directly to Heroku for hosting but I got so many errors. Now, what I did was host the code on Github, and then link the git repo with Heroku. Now, the Heroku app was...

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...

ClobberError while installing virtual environment for conda

I used the command the below command to create a virtual environment for conda with all required bindings in the .yml file. conda env create -f virtual_platform_linux.yml But I am getting this...

Conda takes 20+ minutes to solve environment when package is already installed

NOTE: I'm duplicating this post because the question has been up on the conda github page for ~6-days with no response. The original link is...

Python 3.7 anaconda environment - import _ssl DLL load fail error

I created anaconda environment with Python=3.7 and have trouble with the error of _ssl and DLL. When I tried to get back to my base environment, I have trouble getting the background processes to...

Import error of contextily package in python

I installed the package contextily with pip install contextily, it appears when I do conda list # Name Version Build Channel _ipyw_jlab_nb_ext_conf ...

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...

Python curve fitting with an infinite summation

I am trying to do a curve fitting in python, which include an infinite summation. I always got an error. from mpmath import nsum, exp, inf import numpy as np import pylab from scipy.optimize...

"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...

HDF5 library version error - HDF5 ver 1.10.4

I'm trying to import some packages with spyder (OS x64), Anaconda and pyton 3.x The error is pretty famous in the internet. The solution proposed is to match the version of the library 1.10.5 with...

UnsatisfiableError: The following specifications were found to be incompatible with each other:

I am running on Ubuntu 16.04 and I have run into issues with Anaconda. Due to package inconsistencies, I can no longer install, update or remove packages. $ conda info NVIDIA: no NVIDIA devices...

ERROR: You must give at least one requirement to install -- when running: pip install --upgrade --no-binary hdbscan

I am trying to install hdbscan in my PC which runs Windows 10 and has installed Python 3.6. My first attempt failed: (base) C:\WINDOWS\system32>pip install hdbscan --user Collecting hdbscan ...

No module named 'matplotlib.artist'

I faced with this error No module named 'matplotlib.artist' here is the complete error: --------------------------------------------------------------------------- ModuleNotFoundError ...

error H13 on heroku on an dash application

import requests from bs4 import BeautifulSoup import pandas as pd import dash import dash_core_components as dcc import dash_html_components as html import...

Problem with creating an environment from .yml file, error "CondaEnvException: Pip failed" raised

I am trying to create an environment based on a .yml file, the name of the file is env.yml . I run the following snippet on terminal: conda env create -f env.yml Then anaconda starts...

virtualenv: pre-installed with packages on creating virtual environment

I created a virtual environment using command virtualenv env on my terminal. On using pip freeze > requirements.txt after activating the virtual environment, I was a bunch of packages...

Why does `conda list cudnn` have no output after `conda install pytorch torchvision cudatoolkit=10.2 -c pytorch` installation

*Please feel free to vote "Reopen" at the bottom of this question. The reason is that I have marked this as a duplicate although the answers there are not clear enough for this question.* As soon...

It seems that scikit-learn has not been built correctly

I have been using Jupyter Notebook for my machine learning project. Before scikit-learn was working fine but eventually I installed pip install imblearn and pip install -U imbalanced-learn after...

How to install fenics in Ubuntu using PIP for a particular python environment?

I want to install fenics in Ubuntu 20. First I made a python environment using: sudo apt install python3-venv Then inside the folder I want to make an environment I open a terminal and...

Trouble installing turbodbc

I am attempting to install turbodbc on my Ubuntu 20.10 machine. My specs are as follows: pip 20.2.4, Python 3.8.5 , gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0 I have attempted the solutions provided in...

Invalid requirement

I converted the requirements of my project into a txt file with the method below. pip freeze > requirements.txt And I tried to load the generated txt file with the code below to test it, but I...

Updating packages in conda

I have a problem with updating packages in conda. The list of my installed packages is: # # Name Version Build Channel _anaconda_depends 2020.07 ...

My integral is taking forever or it gives wrong answer after running for 2 or more hours

import numpy as np import matplotlib.pyplot as plt from scipy import integrate from scipy import exp import scipy as sp import mpmath as mp from sympy import polylog from math import * def...

This version of ChromeDriver only supports Chrome version 87 Current browser version is 90.0.4430.93

ChromeDriver is giving an error about its version being too low: This version of ChromeDriver only supports Chrome version 87 Current browser version is 90.0.4430.93. I've updated pip's packages...

Sudden Tensorflow / Keras Google Colab dependency problems `AttributeError: module 'tensorflow._api.v1.compat.v2' has no attribute '__internal__'`

I have running a machine learning model (Matterport's Mask R-CNN) in google colab for a couple of weeks. All of a sudden today I am unable to run any of my notebooks due to I think some kind of...