scikit-learn svm import error - scikit-learn

I'm running Canopy 64-bit on a mac. After installing scikit-learn (using the package manager), I tried to import svm, and got the following error.
ImportError: dlopen(/Users/johnsaccount/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sklearn/svm/liblinear.so, 2): Library not loaded: /System#rpath/libBLAS.dylib
Referenced from: /Users/johnsaccount/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/sklearn/svm/liblinear.so
Reason: image not found
Any ideas on what might be the problem?

Jsen,
My apologies for this error, it was my mistake when building that egg. The update should now be available and fix that error (the fixed version is 0.13.1-3, both 0.13.1-1 and 0.13.1-2 are broken on os x).

Thanks for the report and sorry for the inconvenience.
I can reproduce this, apparently due to a build error on OSX (it works ok on Windows). We'll let you know when it is fixed.

Related

"import _pjsua" Error. DLL load failed: the specific module could not be found

I encountered the following error while executing a python file on Jetbrains Pycharm IDE.
from pjsua import *
import _pjsua
Error. DLL load failed: the specific module could not be found
Initially, I thought this error is related to python installation. So, I re-installed python but i couldn't remove the error.
I ran the code in some other system and the code worked fine.
I think the problem is due to some dependencies.
I figured out that the problem was due to Microsoft Re-distributables. I installed all the versions from 2005 to 2017 (both x86 and x64) and restarted my system.
This resolved my problem.

I am getting an error while installing PATE from SYFT

I am doing a Differential Privacy Course and have to work with syft. When running the below command, I encountered a error
I have already installed syft package required for the analysis. And I am working in Anaconda on Windows 10
from syft.frameworks.torch.differential_privacy import pate
WARNING:tf_encrypted:Falling back to insecure randomness since the required custom op could not be found for the installed version of TensorFlow (1.13.1). Fix this by compiling custom ops.
It is not an error it is a warning. It comes from tf_encrypted which is used in tensorflow. The problem is that on Windows secure randomness is not supported (according to https://github.com/tf-encrypted/tf-encrypted/issues/513). And as you use PyTorch you can just ignore it.

openCV in python on Linux bombs out at show image [duplicate]

I'm having an error running simple code using cv2 module.
It's just:
import cv2
img = cv2.imread('sudoku.png',0)
cv2.imshow('image',img)
And it fails with the following error:
QObject::moveToThread: Current thread (0x1b74720) is not the object's thread (0x1e57d70).
Cannot move to target thread (0x1b74720)
I googled this error and tried a lot of things but it doesn't help. I tried installing without pip, I tried using step-by-step installation (from official OpenCV) but nothing helps.
When I run:
cv2.__version__
It returns 3.4.3
As noted already, the basis for this problem is discussed in opencv-python issue 46, and results from the duplication of the following libraries both on the host and the opencv-python distro libQtDBus libQtCore and libQtGui.
It has been lately addressed in the newest release of opencv-python. It is not a fix to the source code, rather the fix is to force pip to compile the newly available source via
pip install --no-binary opencv-python opencv-python
This will cause opencv-python to use the same libraries as the host, so the conflict no longer exists.
According to this issue posted on the OpenCV GitHub, this is a known issue that the developer states is damn near impossible to fix. It is apparently caused by a conflict in any Qt installations on the system with the Qt that is shipped with OpenCV. There are some suggestions floating around to remove the libqt5x11extras5 package from the system. This may fix it for some but anyone running these libraries on a Linux distribution that uses a window manager based on Qt will render their desktop environment unusable by removing this package (having tried it myself).
You can try building OpenCV from source using the WITH_GTK=ON option when running cmake which will use GTK instead of Qt, circumventing the conflict. However, this is hard to make use of in Python when using virtual environments.
I haven't spent the time to fully appreciate this problem, but as I understand this is caused by multiple conflicting versions of some plugin in the environment. I tried installing building opencv-python but there were errors with that approach. Another suggestion is to change your import order, but I've had mixed success with that, and I couldn't get it to work on a project today.
But I found a workaround that worked for me. Install opencv-python-headless instead of opencv-python. This will avoid installing the conflicting plugins. It may not work for you depending on what features of opencv you need.
$ pip uninstall opencv-python
$ pip install opencv-python-headless
The error was fixed on my system, by simply updating one library.
To find out where it is coming from, assuming Linux, try the following,
LD_DEBUG=files python -c "import cv2"
or,
LD_DEBUG=files python -c "import cv2 ; img = cv2.imread('myimage.png',0) ; cv2.imshow('image',img) ; cv2.waitKey(0)"
On my machine, it failed in one of the blas libraries. I updated that library and the code now runs without error.
This is an old bug you can find it discussed in a number of online communities.
My test code is as follows. Notably the error has not reoccurred, and apparently has nothing to do with Qt.
import cv2
img = cv2.imread('sudoku.png',0)
cv2.imshow('image',img)
cv2.waitKey(0)
To me, the solution to this problem was removing Anaconda, then installing pip followed by installing OpenCV with a simple pip install command.

deepchem installation on mac

I installed deepchem following the instruction on their website. I dint get any error during the installation but when I import deepchem from jupyternotebbok, the kernel will be dead:
The kernel appears to have died. It will restart automatically.
If I import deepchem from terminal, I get
Segmentation fault: 11
Any help is appreciated.
Sorry for the very slow answer on here! DeepChem's latest versions should work on Mac. Can you try installing DeepChem 2.3 and seeing if you're still having issues?

Keras Illegal Instruction 4

I have been trying to get Keras working on my laptop running El Capitan but when I attempt to import it I get the following message
Using TensorFlow backend.
Illegal instruction: 4
I've looked for solutions, and have tried updating theano, installing mxnet-mkl, and running an older version of numpy (1.13) to avoid a FutureWarning error. None of these has seemed to fix the issue, though. I feel like I must be missing something somewhere.
Try installing an older version of TensorFlow (1.5 seems to work). AVX2 instructions are now enabled by default in latest TF pip wheels, meaning if your processor doesn't support these instructions, then you will get an illegal instruction error.
Another solution is to install TensorFlow from source, which should detect your processor and configure it accordingly.

Resources