Import issue for cvxopt on Windows - python

I installed cvxopt verbatim from here. On using it from the python prompt, I see the following issue:
>>> import cvxopt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build\bdist.win32\egg\cvxopt\__init__.py", line 32, in <module>
File "build\bdist.win32\egg\cvxopt\base.py", line 7, in <module>
File "build\bdist.win32\egg\cvxopt\base.py", line 6, in __bootstrap__
ImportError: DLL load failed: The specified procedure could not be found.
>>>
Any ideas to resolve this?

cvxopt requires Numpy-MKL, you can get the windows binary here.
And install the cvxopt binary from here

Related

Cannot run anaconda

I just installed anaconda and I have udpated the PATH variable.
However, I cannot run any conda related commands.
Every time I run a command starting with "conda" I get the following error.
Can anyone help?
I am using macOs High Sierra 10.13.6.
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 18, in <module>
from urllib.request import url2pathname
File "/anaconda3/lib/python3.6/urllib/request.py", line 2585, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /anaconda3/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/bin/conda", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 112, in main
from ..exceptions import conda_exception_handler
File "/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 18, in <module>
from .common.io import timeout
File "/anaconda3/lib/python3.6/site-packages/conda/common/io.py", line 24, in <module>
from .path import expand
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 21, in <module>
from urllib import unquote, url2pathname # NOQA
ImportError: cannot import name 'unquote'
I seem to recall something similar when I first ran Anaconda on my Mac as well. I believe I solved it by doing two things:
Uninstalling Anaconda (Link)
Reinstalling Anaconda (potentially in a different location, say, under your User home)
I think in the process of installation my PATH pointed finally to a different location than the Conda/Python install.

import P4API fails on win 64, python 3.5.1

I'm getting the following error when running import P4:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python35\lib\site-packages\P4.py", line 410, in <module>
import P4API
ImportError: DLL load failed: The specified module could not be found.
OS: Win 7 64 bit
Python: 3.5.1
P4Python: https://pypi.python.org/pypi/P4Python : p4python-2015.2.1348262-cp35-none-win_amd64.whl (md5)
I looked online but couldn't find something that would help.

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

Error importing sdl2 in python3

I have a file test.py which contains only the line "import sdl2". I am running Ubuntu and have installed libsdl2 from the official repos and installed pysdl2 from pip3. I get this error:
Traceback (most recent call last):
File "./test.py", line 2, in <module>
import sdl2
File "/usr/local/lib/python3.3/dist-packages/sdl2/__init__.py", line 11, in <module>
from .events import *
File "/usr/local/lib/python3.3/dist-packages/sdl2/events.py", line 5, in <module>
from .keyboard import SDL_Keysym
File "/usr/local/lib/python3.3/dist-packages/sdl2/keyboard.py", line 7, in <module>
from .video import SDL_Window
File "/usr/local/lib/python3.3/dist-packages/sdl2/video.py", line 256, in <module>
SDL_GL_ResetAttributes = _bind("SDL_GL_ResetAttributes")
File "/usr/local/lib/python3.3/dist-packages/sdl2/dll.py", line 84, in bind_function
(funcname, self._dll))
ValueError: could not find function 'SDL_GL_ResetAttributes' in <CDLL 'libSDL2-2.0.so.0', handle 1088720 at 7fdce18f5910>
My only thought is that possibly there's some version mismatch in packages? I couldn't find anything referencing this bug after a quick googling.
This is a bug in pysdl2, which indicates that your SDL2 library version is not the latest one. (2.0.3). It has been fixed in a recent commit: https://bitbucket.org/marcusva/py-sdl2/commits/03870c58615b115abf14b11056bbcd41652873c5

Installing llvmpy on OSX

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

Categories

Resources