numpy undefined symbol: PyFPE_jbuf - python

I am trying to use the One Million Song Dataset, for this i had to install python tables, numpy, cython, hdf5, numexpr, and so.
Yesterday i managed to install all i needed, and after having some troubles with hdf5, i downloaded the precompiled binary packages and saved them in my /bin folder, and the respective libraries in /lib , after that i tested this python script : http://labrosa.ee.columbia.edu/millionsong/sites/default/files/tutorial1.py.txt
and it worked fine, to be clear the way i made it work was to first run the script and start installing the needed dependencies, but today i restarted my laptop and it didn't work, now it throws me this error on the console :
python2.7 script.py
returns :
import numpy as np # get it at: http://numpy.scipy.org/
from . import random
from .mtrand import *
ImportError: /home/francisco/.local/lib/python2.7/site-packages/numpy/random/mtrand.so: undefined symbol: PyFPE_jbuf
seems to me that there is a missing variable in such file, my guess is that the script is looking for the numpy library in the wrong place, since i made so many failed installations maybe i broke something and it only worked out because it was loaded in the temporal memory of the computer.
I tried installing Anaconda, and i created a new environment and installed the packaged with the anaconda package manager, and even thought i listed all packaged and it returns :
# packages in environment at /home/francisco/anaconda2/envs/Music:
#
biopython 1.66 np110py27_0
cython 0.23.4 <pip>
hdf5 1.8.15.1 2
mkl 11.3.1 0
numexpr 2.5 np110py27_0
numpy 1.10.4 py27_1
openssl 1.0.2g 0
pillow 3.1.1 <pip>
pip 8.1.1 py27_0
pytables 3.2.2 np110py27_1
python 2.7.11 0
python-ldap 2.4.25 <pip>
readline 6.2 2
reportlab 3.3.0 <pip>
requirements 0.1 <pip>
setuptools 20.3 py27_0
sqlite 3.9.2 0
tables 3.2.2 <pip>
tk 8.5.18 0
wheel 0.29.0 py27_0
zlib 1.2.8 0
i still get the same error. I really need help and don't know what else to try. Thanks.

I had the same problem, probably you have installed numpy without Anaconda, so there is a conflict because of this, which numpy to use: that one installed with pip or with conda. When I removed non-Anaconda numpy, error gone.
pip uninstall numpy

For cython users:
This post was helpful. The post explains, that there is some flag (--with-fpectl), which is either set during the compilation of cpython or not. When a library has been compiled using a cpython without that flag, it is incompatible to a version with that flag being set. This effect does only show up when you use cython, as numpy itself does not use this extension.
As further stated in that post, my Ubuntu 16.04 has been created with this flag and Conda without it. For me, it was specifically the module hmmlearn throwing the undefined symbol error. This must be the case because it was shipped by Ubuntu with the flag being set and not by anaconda. So I uninstalled hmmlearn and manually installed it anew from sourcescode (Anaconda, unfortunately, does not offer hmmlearn). --> Works!

irony at it's best, i restarted my laptop without doing nothing, and it worked. Can't understand why.

I agree with previous posts that this seems to be caused by having multiple versions of numpy installed. For me, it wasn't enough to just use pip, as I also had multiple versions of pip installed.
Specifying the specific pip solved the problem:
/usr/bin/pip3 uninstall numpy

Initially, I installed cython using system /usr/bin/pip and anconda pip. I uninstalled system cython using system pip and reinstalled using
conda install cython. Works now.

First remove numpy from /usr/local/lib/python2.7/dist-packages/numpy-1.11.0-py2.7-linux-x86_64.egg
and then use the following command
sudo pip install numpy scipy
I had solve this error in my case.

I ran into this problem in a particular situation. Using Anaconda (3 I think) I was creating a new environment. Previously I had created a py3 env with numpy, Not sure if related. But when creating my new py2.7 environment I went to install a particular package Ta-lib via pip, but then had this same Question's import error relating to numpy for the particular case of Ta-lib.
From this post Gaurav suggested the use of pip flag --no-cache-dir to ensure a rebuild during install of numpy. I uninstalled my Ta-lib and numpy and then reinstalled them with this flag via pip and everything worked great.

Related

"stereoscope" package installation in Python

I have installed the package "stereoscope" successfully a few days ago and have been using it to do analysis. However, when I am trying to use it today I got the error that the command "stereoscope" is not found. I suspect that this error usually comes up when the package is not installed. It is weird I know. Therefore, I tried to install it again. However, I found the problem "numpy 1.21.1 is installed but numpy<1.21,>=1.17 is required by {'numba'}". What I understand from this error is that I need to install the NumPy version less than 1.21.1 or greater than or equal to 1.17. So, I tried to install the required version such as NumPy 1.20.3. The issue remains the same. I do not know why it is still saying my numpy version is 1.21.1 even after I uninstalled this version. Please help me with how to resolve this issue?
This is the link where I follow to do the installation stereoscope installation
I tried to update the numba and use the command "pip list" to get numba version is 0.53.1 and the numpy version is 1.21.1. But still do not resolve the error. I have uninstalled the numpy version 1.21.1 and change it to numpy version 1.20.3 but the error remains.
I have resolved this issue by uninstalled all version of numpy that present on my system. I then create a new virtual environment. I start install the package stereoscope including all required packages on this virtual environment. This way there will be no crush between these installation and my computer system.

How do I install python third party libs on the m1 chip?

The Mac Book Air M1 chip doesn't seem to support pep517 according to the errors of installing third-party libraries with pip or brew. Even using these methods without pep517 downloading the library locally didn't work. How does one circumvent this?
Error from using pip install pandas:
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
I've tried this:
pip install <lib>
installing the library locally and trying to install with pip without pep517
brew install <lib>
openblas installation of lib
python env on the intel venv
I had the exact same problem, with a different library but with the same error code for PEP 517, I was using python 3.9 at the time, I checked the docs and found out that it's a problem with the python version for the library, downgraded to Python 3.6 and voila! it worked.
Basically try downgrading to Python 3.6 and check.
Installing python libraries through Anaconda seems to work. I simply downloaded the installer and could later use the libraries globally. If someone has a better in-depth explanation, feel free to comment.
I was having the same message when trying to install a different package. I solved by removing the CommandLineTools and installing it again. The steps were:
sudo rm -r /Library/Developer/CommandLineTools
wait for command prompt...
xcode-select --install
This solved the issue for me.

BigTiff no longer supported after upgrade to python 3 / gdal 2.3.3

I recently upgraded to python 3 using Anaconda and found there is a problem when trying to load bigtiff files.
ERROR 4: This is a BigTIFF file. BigTIFF is not supported by this version of GDAL and libtiff.
Below is the code that generates the error:
gdalobj = gdal.Open(path\to\bigtiff\file)
Opening small tif files works. I'm using Windows 10, 64 bit, python 3.7.4, gdal 2.3.3, libtiff 4.0.10. I have tried upgrading gdal using conda, conda-forge, and pip as suggested by previous posts with similar problems. Either nothing changes or errors occur during the upgrade. Any suggestions? Thanks in advance for your help.
Have you tried using a newer version of gdal from conda or conda-forge? Like 2.4.1 or 3.0.4?
If that doesn't work you can try installing a .whl file from this page (where it is already built, unlike pip):
https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
This page doesn't have 2.3.3 butit has 2.4.1 instead, make sure to install the amd64 version if you have a 64bit SO (Windows Key + Pause to check).
Install it from inside your enviroment using this command:
pip install C:/dir/to/file/location/gdal-2.4.1.whl
Thanks to Parrawk's suggestions, I created a new conda environment that uses python 3.7.6 (the default installation with Anaconda3 was 3.7.4). From within this env, I ran conda install gdal, which installed gdal 3.0.2. After a few additional installations (matplotlib, statsmodels, etc.) my code worked as expected!

Problems installing TensorFlow on Mac

I am trying to follow to the installation guide on tensorflow.org and have installed Python version 2 again for that reason using Homebrew.
When I run the installation as described
$ pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
I get this error message:
tensorflow-0.5.0-py2-none-any.whl is not a supported wheel on this platform.
I am obviously doing something wrong, but have no idea. Any clues?
I do not want to use virtualenv, since anaconda already comes with its own environment management conda. When installing the newest version 0.6.0 directly with pip install, I had a similar error. It seemed to not resolve the dependencies correctly.
Here is what you can try:
Install anaconda
Create a new conda workspace
Download the specific protobuf version that tensorflow needs: https://pypi.python.org/pypi/protobuf/3.0.0a3
Install it via sudo easy_install ~/Downloads/protobuf-3.0.0a3-py2.7.egg
Install a numpy version greater than 1.08.x via conda install numpy
Download the 0.6.0 version of tensorflow: https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
Install via pip install ~/Downloads/tensorflow-0.6.0-py2-none-any.whl
When you install tensorflow from the whl file directly, it should tell you when dependencies are not there. It seems not to be able to resolve these conflicts independently. My setup had issues with protobuf and numpy. After installing them manually everything worked fine.
I hope this helps!
It seems to be a common issue. Try to install it in the virtualenv. Its a much better solution, as you can always easily set up a new version of tensorflow without conflicts.
VirutalEnv Tutorial:
http://tensorflow.org/get_started/os_setup.md#virtualenv-based_installation
On the Mac, I didn't have any problem installing tensorflow with the anaconda version of python: https://www.continuum.io/downloads
The anaconda version also provides science, math, engineering, and data analysis packages. A lot of people on https://www.kaggle.com/ seem to use this...just a thought.

Trouble installing QSTK on a MAC 10.7.5, probably because of an issue with python-dateutils and/or pandas 0.7.3

I am trying to install QSTK (http://wiki.quantsoftware.org/index.php?title=QSToolKit_Installation_Guide_Mac) on a Mac and am running to trouble. To make a long story short, i started with multiple versions of python on my mac (2.5, 2.6, 2.7, 3.3) and multiple modules (beautifulsoup, requests, etc). In my frustration after hours of trying to get QSTK up and running, i deleted everything python-related and tried to start over. I followed the directions on the QSTK install wiki (the link above), and when i got to step 7, which is to run this:
python QSTK-0.2.5/Examples/Validation.py
on the command line to see if the installation went ok, I get the following feedback from my terminal:
Numpy is installed and the version used is : 1.7.0
Please make sure you're using version >= 1.6.1
Matplotlib is installed and version is : 1.2.0
Please make sure you're using version >= 1.1.0
Please install python-dateutil via easy_install or some method!
Error : Please install Pandas 0.7.3
Error : Pandas can not be imported or not installed.
I found out I needed python-dateutil version 1.5 and not 2.0 (which is the latest), so i tried downgrading it, still no luck. I am very lost on what to do. Help please!
Note: I am a beginner programmer.
Try doing the installation with Homebrew. I assume you were using macports.
I ran into the same issue when installing QSTK.
uninstall macports, and install brew.

Categories

Resources