Installing llvmpy on OSX - python

I've been following this guide. Unfortunately I don't think llvmpy is being installed properly (here is the output from python).
>>> import numba
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/numba/__init__.py", line 5, in <module>
from . import testing, decorators
File "/Library/Python/2.7/site-packages/numba/decorators.py", line 7, in <module>
from numba.targets import registry
File "/Library/Python/2.7/site-packages/numba/targets/registry.py", line 3, in <module>
from numba.targets import cpu
File "/Library/Python/2.7/site-packages/numba/targets/cpu.py", line 4, in <module>
import llvm.core as lc
File "llvm/__init__.py", line 6, in <module>
from llvmpy import extra
File "llvmpy/extra.py", line 5, in <module>
from llvmpy import capsule
File "llvmpy/capsule.py", line 4, in <module>
from llvmpy._capsule import (unwrap, has_ownership, downcast, wrap,
ImportError: No module named _capsule
Doing python -c "import llvm" gives me the same error as above ("No module named _capsule"). Any ideas? I am not getting errors while installing llvm,llvmpy or numba, but it is pretty clear that llvmpy isn't getting installed properly

I forgot to answer this. I solved the problem as the underlying issue was an Apple-release (see this answer to a similar'ish question).
TLDR:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
And then follow the guide given here

Related

jupyter lab is broken how can I fix it?

I can't figure out why jupyter-lab is not working. something is broken and don't know where. I have searched the web for this and can't find a solution. COuld you please help. Appreciate it.
E:\gitrepos>jupyter lab
`Traceback (most recent call last):
File "E:\anaconda3\Scripts\jupyter-lab-script.py", line 3, in <module>
import jupyterlab.labapp
File "E:\anaconda3\lib\site-packages\jupyterlab\labapp.py", line 7, in <module>
from notebook.notebookapp import NotebookApp, aliases, flags
File "C:\Users\Dario.Romero\AppData\Roaming\Python\Python35\site-packages\notebook\notebookapp.py", line 78, in <module>
from .services.kernels.kernelmanager import MappingKernelManager
File "C:\Users\Dario.Romero\AppData\Roaming\Python\Python35\site-packages\notebook\services\kernels\kernelmanager.py", line 19, in <module>
from jupyter_client.session import Session
File "E:\anaconda3\lib\site-packages\jupyter_client\session.py", line 61, in <module>
from jupyter_client.jsonutil import extract_dates, squash_dates, date_default
File "E:\anaconda3\lib\site-packages\jupyter_client\jsonutil.py", line 11, in <module>
from dateutil.parser import parse as _dateutil_parse
ImportError: No module named 'dateutil.parser'`
You need to install the dateutil library: https://pypi.python.org/pypi/python-dateutil/
(If you used a package manager, the dependencies for JupyterLab should already have been installed. If you didn't, then you will need to install the dependencies yourself.)

Python embedding, ImportError: cannot import name _remove_dead_weakref

I am trying to run some C++ code with embedded Python. Code was working completely fine a couple of weeks ago. The code still compiles, but I am now getting the error
Traceback (most recent call last):
File "./main.py", line 1, in <module>
import numpy as np
File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 74, in <module>
from numpy.testing.nosetester import _numpy_tester
File "/usr/local/lib/python2.7/site-packages/numpy/testing/__init__.py", line 10, in <module>
from unittest import TestCase
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/__init__.py", line 64, in <module>
from .main import TestProgram, main
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 7, in <module>
from . import loader, runner
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/runner.py", line 7, in <module>
from .signals import registerResult
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/signals.py", line 2, in <module>
import weakref
File "/usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
Since then the only change I have made is to install the macOS Supplemental Update and to upgrade Python from 2.7.13_1 to 2.7.14_2 (using Homebrew). I have changed the relevant linker flags in the makefile, i.e. those that appear when I type python-config --ldflags. I have also made sure that the Python I am using is definitely the Homebrew one by inserting export PATH="/usr/local/opt/python/libexec/bin:$PATH" into my .bash_profile as directed by Homebrew.
I am not sure whether this error is because of the Python update, the recent macOS Supplemental Update, or something else. Any idea what the problem could be?
Thanks
I had the same problem;
In python 2.7 the NumPy 1.8.0 was available,
Then I installed NumPy (again) using brew, and it wasn't available in my python (2.7) anymore. (Got the same error you got here)
So I did "brew unlink python && brew link python" to use python 3 (instead of 2) which NumPy 1.14 is available in it.
I guess the python 2.7 was not compatible with this recent version of NumPy.

pip install of statsmodels is not working. DLL load failed: The specified module could not be found

I am really new to python and I am trying to install the statsmodels module. It seems that since I am on a 64 bits I need to use the following unofficial website http://www.lfd.uci.edu/ I did all I know about how to download a whl and I did download it and used the pip afterwards and all work fine. now when I do pip install statsmodels it work fine. However, in my shell after I try import the stats models I am getting
import statsmodels
Traceback (most recent call last): File "<pyshell#7>", line 1, in <module>
import statsmodels File "D:\Python34\lib\site-packages\statsmodels\__init__.py", line 8, in <module>
from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning, File "D:\Python34\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical File "D:\Python34\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.linalg import svdvals File "D:\Python34\lib\site-packages\scipy\linalg\__init__.py", line 174, in <module>
from .misc import * File "D:\Python34\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from .blas import get_blas_funcs File "D:\Python34\lib\site-packages\scipy\linalg\blas.py", line 155, in <module>
from scipy.linalg import _fblas ImportError: DLL load failed: The specified module could not be found.
Any help would be much appreciated.
Thank you in advance

Trouble importing numba

Ok, I'm using python 3.3. I have numpy, llvm, llvmpy, llpyhton, llvm_array, llvm_cbuilder and llvmath installed. I have also installed numba.
However, when trying to import via import numba, the following error appears. I have no idea of what could be missing:
Traceback (most recent call last):
File "/home/pablo/workspace/Pruebas/src/Prueba2/__init__.py", line 1, in <module>
import numba
File "/usr/local/lib/python3.3/dist-packages/numba/__init__.py", line 18, in <module>
from numba import utils, typesystem
File "/usr/local/lib/python3.3/dist-packages/numba/utils.py", line 102, in <module>
context = get_minivect_context()
File "/usr/local/lib/python3.3/dist-packages/numba/utils.py", line 100, in get_minivect_context
return NumbaContext()
File "/usr/local/lib/python3.3/dist-packages/numba/minivect/miniast.py", line 138, in __init__
import llvm.core as llvm_py_not_available # llvm-py not available
File "/usr/local/lib/python3.3/dist-packages/llvm/__init__.py", line 6, in <module>
from llvmpy import extra
File "/usr/local/lib/python3.3/dist-packages/llvmpy/extra.py", line 6, in <module>
from llvmpy import _api
ImportError: libLLVM-3.2.so: cannot open shared object file: No such file or directory
Any ideas?
Ok, I found out what was wrong.
I added the anaconda folders to the deafault python3 interpreter, instead of installing numba directly in the packages folder.

importing numpy on an ARM processor

I have python 2.4 installed on an ARM processor and have moved all of the libraries I need onto this machine including those for numpy 1.6.2 When I try to import numpy, I get the following:
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/numpy/__init__.py", line 137, in ?
import add_newdocs
File "/usr/lib/python2.4/site-packages/numpy/add_newdocs.py", line 9, in ?
from numpy.lib import add_newdoc
File "/usr/lib/python2.4/site-packages/numpy/lib/__init__.py", line 4, in ?
from type_check import *
File "/usr/lib/python2.4/site-packages/numpy/lib/type_check.py", line 8, in ?
import numpy.core.numeric as _nx
File "/usr/lib/python2.4/site-packages/numpy/core/__init__.py", line 5, in ?
import multiarray
ImportError: /usr/lib/python2.4/site-packages/numpy/core/multiarray.so: cannot open shared object file: No such file or directory
When I try to see if the file exists I get:
# ls /usr/lib/python2.4/site-packages/numpy/core/ | grep multi
multiarray.so
I'm pretty new to python in general and don't know why I'm getting this error. Any suggestions?
this is indeed the first error you have when you are trying to import numpy with binaries for the wrong architecture.
some inspiration for compiling to arm : https://github.com/kivy/python-for-android

Categories

Resources