python 3.5 - cannot use cvxopt - python

Trying to use cvxopt with Anaconda.
Followed installation instruction here: How to install cvxopt for Python 3.5 on Windows 7
But got the error:
import cvxopt
File "C:\Anaconda3\lib\site-packages\cvxopt\__init__.py", line 32, in <module>
import cvxopt.base
ImportError: DLL load failed:
Also tried to install numpy-mkl, but also got error "No matching distribution found for numpy-mkl"
I don't seem to find cvxopt.base or pyd in the site-package folder though. What to do next please?
Environment: Windows 7 64 bit; conda 4.3.22 (python 3.5)

Resolved by following below:
import cvxopt.base: the specified module could not be found
Reinstalled numpy and cvxopt from:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
It seems the cvxopt installation mentioned here causes some problems on my machine (unknown version number):
How to install cvxopt for Python 3.5 on Windows 7

Related

Python package dependency is causing an error

The folder Python37\site-packages\scipy\sparse\linalg\isolve\ inside Scipy package in Python has the following file: _iterative.cp37-win_amd64.pyd.
When I run a Python file, I get the following error :-
File "C:\......\Python37\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 10, in <module>
from . import _iterative
ImportError: DLL load failed: The specified module could not be found
(I am new to Python on Windows)
As I cannot comment due to a lack of reputation:
Have you installed scypy with all the mentioned dependencies on their website?
python -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
(Taken from https://www.scipy.org/install.html)
This is how I was able to resolve the issue (on Windows) :-
1. I uninstalled Python using python.exe program.
2. Installed anaconda for Windows - it installs python along with dependencies and many common libraries.

from torch._C import * ImportError: DLL load failed: The specified module could not be found

I am trying to import torch in my windows machine using python 3.5. (CPU only)(pip)
I have followed the steps given in the official website.
When I try to import torch it gives me the error:
from torch._C import *
ImportError: DLL load failed: The specified module could not be found.
I have looked up from torch._C import * (ImportError: DLL load failed: The specified module could not be found. and ModuleNotFoundError: No module named 'torch._C' and followed their instructions, still the error persists.
The total traceback:
Traceback (most recent call last):
File "D:\CFPS.py", line 1, in <module>
import torch
File "C:\Program Files (x86)\Python35\lib\site-packages\torch\__init__.py",
line 78, in <module>
from torch._C import *
ImportError: DLL load failed: The specified module could not be found.
[Finished in 0.6s]
Is there a way to get past through this?
I've been encountering the same problem. Pytorch seems to require openmp, however this is not part of the PIP distribution.
If you install Pytorch through Anaconda, the Anaconda install includes openmp, so this problem goes away.
To resolve this problem with pip, you can
pip install intel-openmp
but you still have to copy the openmp binaries from Python\Library\bin over to
Python\Lib\site-packages\torch\lib
Here's a link to the pytorch issue
pytorch issue
I had the same issue for Windows 10 machine without CUDA, and in my case it's caused by the pytorch I installed is a CUDA version, then I uninstalled it and installed a CPU version pytorch, the problem solved.
I had the same issue for Windows 10. Solved this by running conda install pytorch -c pytorch
I had the same issue. Use CPU version of pytorch if you are using a machine without GPU. The following command should work.
conda install -c peterjc123 pytorch-cpu
Same issue, but I have cuda GPU. Go to https://developer.nvidia.com/cuda-downloads and install the version of cuda you selected for pytorch, reboot, and worked for me. Hope it helps you!

How to install scipy module installation?

I'm trying to install scipy 0.19 for python 3.6 windows 10 32 bit version. I tried the pip installation method but it doesn't work then i also downloaded the .whl file for scipy then also the program shows that "no module named scipy". How do I solve this problem?

OpenCV in Python: "ImportError: DLL load failed"

So many questions already about this topic, but I didn't find any satisfying answer about the "DLL not found" traditional issue.
I'm using Python 3.5 installed via Anaconda 3;
I have installed with pip the 'official' opencv_python-3.2.0.6-cp34-cp34m-win_amd64.whl (right from here https://pypi.python.org/pypi/opencv-python);
Windows version is 7 - 64 bits;
I have uninstalled all the redistributable VC++ that were present on my machine and reinstalled its 2015 version - so the famous as well as mandatory DLL msvcp140.dll is present on my laptop;
the cv2 module is present in the Lib/site-packages directory;
it contains, among others, file 'cv2.cp35-win_amd64.pyd'.
Meanwhile, I still can't get access to cv2:
>>> import cv2
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import cv2
File "C:\Program Files\Anaconda3\lib\site-packages\cv2\__init__.py", line 7, in <module>
from . import cv2
ImportError: DLL load failed: The specified module could not be found.
Modifying the name of the .pyd --> cv2.pyd does not solve the problem, nor does the installing via pip of the unofficial but great wheel version from Gohlke (http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv)
Any idea about what is going on?
As mentioned in the comment which I didn't notice at first, you can resolve this by installing from the unofficial site (Gohlke)
(http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv)
I uninstalled the official one by calling:
pip uninstall opencv-python
And then downloaded the .whl package from the mentioned site (you need to carefully choose the correct python version and the correct processor architecture x86 or x64).
And then, go to the path where the .whl file is downloaded and call:
pip install opencv_python-x.x.x-cpxx-cpxxm-win_xx.whl
Regarding the comment in the question, always remove any existing opencv package before installing another one because, opencv from unofficial and official sites will be considered as 2 packages by pip.
You can install official opencv if you follow my answer here. You get that error because of a problem with Anaconda.
But if you install official opencv it will autocomplete and give suggestions in your python IDE (see this). So, if you need autocomplete as well, you need to go with unofficial opencv.
I had the same issue. This helps me:
conda install -c menpo opencv3
Found at https://www.scivision.co/install-opencv-python-windows/

Pandas 0.14.1 import dll error

I'm using python 2.6.6 (32bits) on windows 7 and I try to upgrade from Pandas 0.13.0 to Pandas 0.14.1
I can't upgrade to newer version of python due to IT policy.
I tried using the tar.gz package, using the compiled pandas version found here pandas‑0.14.1.win32‑py2.6.exe, even reinstalling everything (numpy, py-tz, dateutil...), but I got always the same error:
File "c:\python26\lib\site-packages\pandas\__init__.py", line 6, in <module>
from . import hashtable, tslib, lib
ImportError: DLL load failed: The specified procedure could not be found.
I defined the python path PYTHONPATH to C:\Python26\Lib;C:\Python26\DLLs;C:\Python26\Lib\lib-tk; but it does not make any difference. However the hashtable.pyd, tslib.pyd and lib.pyd do exist in the proper directory.
I've googled the problem, and in some case using the exe from the site of Christoph Gohlke helps , but I already tried and the error is always the same.
Any idea? So far I'm blocked to version 0.13.0 as even 0.13.1 gives the same error.
Thanks.

Categories