How to Install M2crypto on Windows - python

After installing OpenSSL, downloading the pre-built Swig executable, and ensuring the openssl libraries are located in the default c:\pkg, pip install m2crypto results in:
...
C:\Program Files (x86)\gfortran\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Pyth
on27\include -IC:\Python27\PC -Ic:\pkg\include -Ic:\users\evbo\appdata\local\tem
p\pip_build_evbo\m2crypto\SWIG -c SWIG/_m2crypto_wrap.c -o build\temp.win32-2.7\
Release\swig\_m2crypto_wrap.o -DTHREADING
gcc: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1
It seems the binary installer solution for M2crypto is no longer available and I don't see any mistakes I've made based on the M2crypto install doc.
How might I resolve this install issue? Is there a dependency on older versions of GCC?

I got lucky - there's an unofficial binary installer in lieu of chandlerproject.org/bin/view/Projects/MeTooCrypto being down:
https://github.com/saltstack/salt-windows-install/blob/master/deps/win32-py2.7/M2Crypto-0.21.1.win32-py2.7.msi

This answer is based on the GitHub comment at https://github.com/iOSForensics/pymobiledevice/issues/25#issuecomment-576119104, for a Python module that requires m2crypto.
Some builds for m2crypto for specific versions of Python are available from their CI: https://ci.appveyor.com/project/m2crypto/m2crypto/history. Try selecting a version, selecting a job that matches your Python version, then going to the "Artifacts" tab and downloading an installer. To install a .whl file, see step 11 of my build tutorial below.
M2Crypto-0.35.2.win-amd64-py3.8.zip is the m2crypto module that I have built on Windows 10 x64, Python 3.8.1. It should work on any x64-based version of Windows with any version of Python 3.8.X.
However, if you are unable to find a build that matches your Python version and system type and architecture, you may need to manually build m2crypto. I adapted the build steps from their CI build scripts: https://gitlab.com/m2crypto/m2crypto/blob/master/appveyor.yml. I built the module by doing the following:
Install the latest Build Tools for Visual Studio 2019. See https://visualstudio.microsoft.com/downloads/ under "All Downloads" -> "Tools for Visual Studio 2019". This direct link was active as of this writing: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16
In the installer, select "C++ Build Tools", install, and reboot if necessary.
Install the latest full (not Light) OpenSSL for your architecture (Win64/Win32). Current version as of this writing is 1.1.1d. Make note of the directory to which you install OpenSSL. https://slproweb.com/products/Win32OpenSSL.html
In PowerShell, install the Chocolatey package manager. I used this command from their website: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Install swig with Chocolatey (in PowerShell). choco install -r -y swig
Install the pywin32 dependency. Run pip install pywin32. If you have problems, try first running pip install wheel. To get pip to target a specific Python installation, try launching it using py -[version] -m pip install [module]. Note: you may need to use an elevated (administrator) PowerShell to install Python modules.
Get the latest m2crypto code. If you have git installed, run git clone https://gitlab.com/m2crypto/m2crypto. Otherwise, download and extract the code from GitLab: https://gitlab.com/m2crypto/m2crypto/-/archive/master/m2crypto-master.zip
Use cd to change into the directory m2crypto was cloned/extracted to.
Assuming python launches your desired Python interpreter version, run python setup.py build --openssl="C:\Program Files\OpenSSL-Win64" --bundledlls, replacing C:\Program Files\OpenSSL-Win64 with the directory to which you installed OpenSSL. (On some systems you can use the py launcher to specify a Python version to use, run py -h for more information.)
Generate the installable files. python.exe setup.py bdist_wheel bdist_wininst bdist_msi.
Install the module. cd into the dist directory and run pip install M2Crypto-0.35.2-cp38-cp38-win_amd64.whl, replacing the filename with the generated .whl file. If you have problems, try first running pip install wheel. To get pip to target a specific Python installation, try launching it using py -[version] -m pip install [module]. Alternatively, you can run the generated .exe or .msi installer. Note: you may need to use an elevated (administrator) PowerShell to install Python modules.

The https://gitlab.com/m2crypto/m2crypto project provides Windows builds of M2Crypto.
You can find wheels for current Python versions from their AppVeyor builds at https://ci.appveyor.com/project/m2crypto/m2crypto.
For example, to install M2Crypto 0.37.1 from https://ci.appveyor.com/project/m2crypto/m2crypto →
https://ci.appveyor.com/project/m2crypto/m2crypto/builds/37187357/job/5c56adinoe9l8kng/artifacts with pip for 64-bit Python 3.8, run:
pip install \
https://ci.appveyor.com/api/buildjobs/5c56adinoe9l8kng/artifacts/dist/M2Crypto-0.37.1-cp38-cp38-win_amd64.whl
NB! The artifacts may expire in AppVeyor, see this bug for updates.

It's late 2019 and installing M2Crypto is still a pain! After a ton of Googling, finally got it down to the steps below:
pip install wheel
pip install M2CryptoWin32
Using a fresh Python 2.7.17 32bit install on Windows 10. You might need install http://aka.ms/vcpython27 first.
I'd imagine one should use M2CryptoWin64 instead if you've installed 64-bit Python.

in windows, (python versions 3.7 | 3.8 | 3.9 | 3.10) you can download whl file from here and install it with this command:
python install M2Crypto-0.38.0-cp310-cp310-win_amd64.whl
replace current whl file name.

1~11: https://stackoverflow.com/a/59817750
12: install M2Crypto.whl and adb in one command
pip install M2Crypto-0.38.0-cp310-cp310-win_amd64.whl adb

Related

chocolatey says it has successfully force reinstalled python 3.11 - but I can't find it

Windows 11.
I am not great at virtual environments, and I have bumped around between a half dozen different "solutions." I thought I had it solved with chocolatey, but I am trying to install python3.11, and not having success. Basically, choco says it is installed, but I can't find it anywhere.
C:\Windows\System32>choco install --force python --version=3.11
Chocolatey v1.2.0
Installing the following packages:
python
By installing, you accept licenses for the packages.
python v3.11.0 already installed. Forcing reinstall of version '3.11.0'.
Please use upgrade if you meant to upgrade to a new version.
Progress: Downloading python 3.11.0... 100%
python v3.11.0 (forced) [Approved]
python package files install completed. Performing other installation steps.
The install of python was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\python'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
C:\Windows\System32>
This gives the impression that python would be in C:\ProgramData\chocolatey\lib\python, but the only files in that directory are python.nupkgandpython.nuspec`
Where do I go to find my shiny new python?
From PowerShell, run get-command python.exe
And you will get something like this:
CommandType Name Version Source
----------- ---- ------- ------
Application python.exe 0.0.0.0 C:\Users\Paul\AppData\Local\Microsoft\WindowsApps\python.exe
The Source column is where it is running python.exe from and where python is installed.
The python package on the Chocolatey Community Repository is a metapackage. So it does not install python, instead, it has a dependency on python2 or python3 (depending on the version of python), that dependent package is what actually installs Python. So if you install python v3.11, that will have a dependency on python3 v3.11, and the python3 package will download and run the Python installer.
Instead of force installing python, try for installing python3 to rerun the Python installer.
As for the install location, packages install to $env:ChocolateyInstall\lib\. So the .nupkg, .nuspec, chocolateyInstall.ps1, etc will all be there. But the python3 package runs the Python installer, and the Python 3.11.x installer will by default install to C:\python311 when run by the chocolateyInstall.ps1 in the python3 package.

"ModuleNotFoundError: No module named 'pysqlcipher3'" error while using Python 3.7 on windows 10

I am trying to decrypt one database file using Python 3.7. To decrypt it, I have to use pysqlcipher3 version for python 3.7. To install it, I have tried by using both commands:
pip3 install pysqlcipher3
and
pip install pysqlcipher3
and both the commands have showed successful installation of the pysqlcipher package. However, when I try to import pysqlcipher3 in my Python project by using this line:
from pysqlcipher3 import dbapi2 as sqlite
it displays this error:
ModuleNotFoundError: No module named 'pysqlcipher3
I have checked various GitHub projects, but none of them provide a clear working solution. The Python packages website says to install libsqlcipher in your OS but this time the issue is same, no documentation and link regarding for the installation of libsqlcipher for Windows 10. Can anyone provide me with proper installation steps, or any document, or any video tutorial, regarding the same? Or is there some issue with the import statement?
You need to install de library libsqlcipher-dev from your repository manager, for example:
sudo apt install libsqlcipher-dev
I don't normally post answers, but this worked for me on Ubuntu:
$ git clone https://github.com/coleifer/sqlcipher3
$ cd sqlcipher3
$ python setup.py build # Build against the system libsqlcipher
$ sudo python setup.py install
$ cd ..
then enter a python prompt and try:
from sqlcipher3 import dbapi2 as sqlcipher
Check if you have multiple pip installations by using
where pip
Also, check the interpreter being used in your project. Make sure it matches the python interpreter corresponding to the pip installation where the module was installed.
You might have to install libsqlcipher from source.
From https://github.com/sqlcipher/sqlcipher
Using MSVC
On Windows, all applicable build products can be compiled with MSVC.
First open the command prompt window associated with the desired
compiler version (e.g. "Developer Command Prompt for VS2013"). Next,
use NMAKE with the provided "Makefile.msc" to build one of the
supported targets.
For example:
mkdir bld
cd bld
nmake /f Makefile.msc TOP=..\sqlite
nmake /f Makefile.msc sqlite3.c TOP=..\sqlite
nmake /f Makefile.msc sqlite3.dll TOP=..\sqlite
nmake /f Makefile.msc sqlite3.exe TOP=..\sqlite
nmake /f Makefile.msc test TOP=..\sqlite
There are several build options that can be set via the NMAKE command
line. For example, to build for WinRT, simply add "FOR_WINRT=1"
argument to the "sqlite3.dll" command line above. When debugging into
the SQLite code, adding the "DEBUG=1" argument to one of the above
command lines is recommended.
SQLite does not require Tcl to run, but a Tcl installation is required
by the makefiles (including those for MSVC). SQLite contains a lot of
generated code and Tcl is used to do much of that code generation.
go checkout where your pip from by using pip -V, it outputs the pip path to you.
Check if this path is in the venv you want. If not, the package was installed in a wrong path.
Check if you have multiple python versions installed on your Operating System. Also if you are using a virtual environment you should activate that before installing any packages.
You'll need to install sqlcipher and the python library pysqlcipher3 with something like:
brew install sqlcipher
pip3 install pysqlcipher3 --user

'import quandl' produces 'Process finished with exit code -1073741819 (0xC0000005)'

Here is my entire program:
import quandl
print("Hello World");
which results in:
Process finished with exit code -1073741819 (0xC0000005)
In the first place I imported Quandl, but then I received:
ModuleNotFoundError: No module named 'Quandl'
and then I googled it and read a suggestion to change the name to quandl.
I have installed the package in the project intercepter, there it's named Quandl though. Anyway, it looks like at least with the lower case it passes the compilation.
I run my program on Windows 10. My Python version is 3.7. I use PyCharm.
If I try to import a different package, then it works. Quandl is the problematic one.
Quandl is a pure Python distribution (containing only Python code), so when you get an access violation error on import quandl, it can either mean that:
your Python installation is broken, which is not the case here as you mentioned other packages working, or that
Quandl imports some broken dependency.
In your case, it's pandas causing the issue. First of all, check what platform/ABI tags pip reports on your machine:
pip<10:
$ python -c "import pip; print(pip.pep425tags.get_impl_tag())"
$ python -c "import pip; print(pip.pep425tags.get_abi_tag())"
$ python -c "import pip; print(pip.pep425tags.get_platform())"
pip>=10:
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_impl_tag())"
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_abi_tag())"
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_platform())"
Be sure to use the correct Python version if you have multiple installed (version check with python --version); replace python with py -2 or py -3 if necessary.
The impl tag is an abbreviation for your Python implementation, usually CPython; for example, cp35 means CPython of major version 3.5 etc. The ABI tag consists of three parts: Python implementation abbreviation, impl version (same as in Python tag) plus the ABI flags (for example, m if your Python impl was built with --with-pymalloc etc). You platform should be either win_amd64 for 64 bit Windows, or win32 for 32 bit one.
Now check if there is a wheel with precompiled extensions available for your platform: go to https://pypi.org/project/pandas/#files and browse through the list of files. Look for a file pandas-0.23.4-{impl tag}-{ABI tag}-{platform tag}.whl.
PyPI wheels
If there is a wheel file suitable for your current platform, copy its link and run:
$ pip uninstall -y pandas
$ pip install https://copied-link-to-wheel-file
If pip uninstall fails, run
$ pip install --force-reinstall https://copied-link-to-wheel-file
instead.
third-party wheels
If no wheel is available from PyPI, you may look for other wheel sources; often https://www.lfd.uci.edu/~gohlke/pythonlibs contains prebuilt wheels for Windows. Check out the list of pandas wheels available there. If a wheel matches your platform, download it and run
$ pip uninstall -y pandas
$ pip install c:/path/to/downloaded/wheel/file.whl
building from source dist
If no wheels are available for your platform, you have to build pandas from source. In this case, you need to install a C compiler (Visual C++ build tools on Windows) and run:
$ pip uninstall -y pandas
$ pip install pandas --verbose --no-cache-dir --no-binary=pandas --global-option="--inplace"
Be sure to install the correct Visual C++ build tools, for example, Python 3.7 requires the 2017 version, while Python 3.4/3.5/3.6 require the 2015 version. Also, make sure you have a recent setuptools version; upgrade if necessary:
$ pip install --upgrade setuptools
It may be wise to copy and store the build log if you encounter any problems after installation, you may get a clue from warnings emitted on build.
Now install pytest and run the tests to validate the installation:
$ pip install pytest
$ python -c "import pandas; pandas.test()"
If the tests fail and you downloaded the wheel from PyPI, open a new issue in pandas' Github repo as the wheel should be supported on your platform, but is isn't. In both other cases (installing third-party wheels or building from source), you're on your own. If you're building from source, ask another question here, providing the full build log.
You Probably have not installed the Quandl package properly. Because I've tried it in Juypter Notebook before installation it gives me the same error that you are getting.
But after installing the package it works fine.
Please see the attached screenshot.
Incase of command line installation please type the following command:
pip install quandl
Quandl Installation Link
If it gives the pip installation then first you need to install pip.
Well, I use Quandl with Canopy and Anaconda (Windows and Mac) and never had any kind of problem at all. Sorry I did not see that you had already installed.
But on the other hand, I had some troubles using pip when I did not run it as administrator - sometimes it said that the package was installed but it was not.
if you install quandl sucessfully, then check where it installed. Generally, default library resides in
your installed python directory/lib, , in my case C:/Program Files (x86)/Python37-32/lib
and pip installs third party packages into
(your python dir/lib/site-packages, in my case C:/Program Files (x86)/Python37-32/lib/site-packages
you should be able to find quandl packages there, if not then you did not installed it correctly. And if you use pip in a venv(i.e, VirtualEnv- find more about venv at https://docs.python.org/3/tutorial/venv.html and pycharm uses venv by default, you'll find the library in (your project location)/venv/lib/site-packages, which in my case, C:/Users/user/Documents/PyProject1/venv/lib/site-packages, you'll definitely find your quandl packages there too; if not you need to re-install it. Python import mechanism is,
it always tries find modules into your code file home directory, PYTHONPATH, standard library directories, site-packages directory, .pth files, by default. you can see the path by the following command,
import sys
print(sys.path)
then you can check the paths, check for quadl installation dir, if it's not in site-packages as mentioned earlier(which may be an exception and installation fault), update it. check PYTHONPATH in Windows
If you use pycharm then when you create a project, expand the
project Interpreter:new virtual environment, then check inherit global site-packages, then pycharm automatically import third party packages into venv site-packages.
and also you need to install anything using pip with administrator privileges in windows, otherwise pip'll not install packages correctly. Hope this helps

dlib installation on Windows 10

I want to use dlib with python for image recognition. I have the python app running great with OpenCV on Windows 10, but when I want to install dlib from the cmd it gives me this following error :
error: Cannot find cmake, ensure it is installed and in the path. You
can install cmake using the instructions at https://cmake.org/install/
You can also specify its path with --cmake parameter.
What should I do?
Install Dlib from .whl
Dlib 19.7.0
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
You can test it, downloading an example from the site, for example SVM_Binary_Classifier.py and running it on your machine.
Note: if this message occurs you have to build dlib from source:
dlib-19.7.0-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform
Install Dlib from source (If the solution above doesn't work)##
Windows Dlib > 19.7.0
Download the CMake installer and install it: https://cmake.org/download/
Add CMake executable path to the Enviroment Variables:
set PATH="%PATH%;C:\Program Files\CMake\bin"
note: The path of the executable could be different from C:\Program Files\CMake\bin, just set the PATH accordingly.
note: The path will be set temporarily, to make the change permanent you have to set it in the “Advanced system settings” → “Environment Variables” tab.
Restart The Cmd or PowerShell window for changes to take effect.
Download the Dlib source(.tar.gz) from the Python Package Index : https://pypi.org/project/dlib/#files extract it and enter into the folder.
Check the Python version: python -V. This is my output: Python 3.7.2 so I'm installing it for Python3.x and not for Python2.x
note: You can install it for both Python 2 and Python 3, if you have set different variables for different binaries i.e: python2 -V, python3 -V
NOTE: Make sure to open the PowerShell as admin, and you're inside the dlib directory before proceeding to step 6
Run the installation: python setup.py install
Linux Dlib 19.17.0
sudo apt-get install cmake
wget https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
tar -xvzf dlib-19.17.0.tar.gz
cd dlib-19.17.0/
sudo python3 setup.py install
note: To install Dlib for Python 2.x use python instead of python3 you can check your python version via python -V
Follow these steps:
pip install cmake
Install Visual Studio build tools from here.
In Visual Studio 2017 go to the Individual Components tab, Visual C++ Tools for
Cmake, and check the checkbox under the "Compilers, build tools and runtimes" section.
pip install dlib
Effective till now(2020).
pip install cmake
conda install -c conda-forge dlib
If you are using Anaconda Prompt (recommended),
conda install -c conda-forge dlib
Or you can use the approach mentioned below:
After spending a lot of time, this comment gave me the right result.
https://github.com/ageitgey/face_recognition/issues/802#issuecomment-544232494
Download Python 3.6.8 and install, make sure you add it to PATH.
Install NumPy, scipy, matplotlib and pandas in your pc/laptop with this command in command prompt:-
pip install numpy
pip install scipy
pip install matplotlib
pip install pandas
Go to https://pypi.org/project/wheel/#files and right-click on filename wheel-0.33.6-py2.py3-none-any.whl (21.6 kB) and copy link address. Then go to your pc/laptop, open command prompt and write this command "python -m pip install" after this command space first then paste the link copied. After installing successful go to the next step.
Then go to this link, https://pypi.org/simple/dlib/ and right-click on filename "dlib-19.8.1-cp36-cp36m-win_amd64.whl" then copy link address. Then open command prompt and do the same as step 2 which is, write this command "python -m pip install" after this command space first then paste the link copied. then the dlib will be installed successfully.
After that, type python and enter, then type import dlib to check dlib is installed perfectly. you can proceed to install face recognition.py which suite for python 3.6.
As you can see many answers above, But i would like to post a quick solution which works for sure in Anaconda3. I haven't chosen Visual Studio as it consumes lot of memory.
Please follow the below steps.
Step 1:
Install windows cmake.msi and configure environment variable
Step 2:
Create a conda environment, and install cmake using the below command.
pip install cmake
Step 3:
conda install -c conda-forge dlib
Note you can find few other dlib packages, but the above one will works perfectly with this procedure.
dlib will be successfully installed.
You need to install Cmake.
dlib is an c++ libary with python bindings. It needs to be builded first. My guess is this will happen automatically once you have installed Cmake
So basically I have been searching the solution for two days.
I tried everything
Installing Cmake
Adding path
installing dlib from the links mentioned in the answers
Installing ## Heading ## numpy, scipy, matplotlib, pandas
etc etc etc
BUT THE ONLY SOLUTION THAT WORKED WAS
INSTALLING MICROSOFT VISUAL STUDIO C++
After installing MS VS C++ I ran command pip install dlib and it is working like a charm.
BEST OF LUCK
Link to download Visual Studio C++
https://visualstudio.microsoft.com/thank-you-for-downloading-visual-studio-for-cplusplus/?sku=Community&rel=16&rid=30005
You have to install cmake as the error tells you.
you can follow this instructions https://www.learnopencv.com/install-dlib-on-windows/
or directly install cmake from here https://cmake.org/download/
Once cmake is installed pip install dlib should work.
I had vstudio building tools installed whe I did my test.
Choose dlib .whl file according to your installed python version.
For example if installed python version is 3.6.7 , 64bit system or if python is 3.5.0 32 bit
then choose dlib-19.5.1-cp36-cp36m-win_amd64.whl and dlib-18.17.100-cp35-none-win32.whl respectively.
Bolded text says the python supporting version.
Download wheel file from here or copy the link address
pip install dlib-19.5.1-cp36-cp36m-win_amd64.whl
for above method .whl file shoud be in the working directory
or
Below link for python3.6 supporting dlib link, for python 3.5 u can replace with dlib 35.whl link
pip install https://files.pythonhosted.org/packages/24/ea/81e4fc5b978277899b1c1a63ff358f1f645f9369e59d9b5d9cc1d57c007c/dlib-19.5.1-cp36-cp36m-win_amd64.whl#sha256=7739535b76eb40cbcf49ba98d894894d06ee0b6e8f18a25fef2ab302fd5401c7
1.use python 3.6.9 version
2.first install cmake.
conda install -c anaconda cmake
use these command to install dlib
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
Just a quick update on what has worked for me (two years later). Davis King has provided two ways to add the latest python dlib (19.17.0) to any python environment in Windows 10 for me. Note, I run several Linux configs in Oracle VirtualBox but Windows 10 is my native OS which has access to the Nvidia GPU so i need an install on Windows 10. (Cannot access the GPU - easily - through VirtualBox).
First - the easiest:
pip install dlib
and the website link: https://pypi.org/project/dlib/
And then it can be easily be build from sources. Download from https://pypi.org/simple/dlib/ and follow instructions on http://dlib.net/compile.html.
Also, just found another way to access with Visual Studio 2019 (or 2017). Use vcpkg - see link https://vcpkg.readthedocs.io/en/latest/
I built dlib 19.17 on Windows 10 with CMake and it worked fine but then I found vcpkg and now the dlib libraries are integral to the Visual Studio. I no longer need to add all the external links to C++ and the linker.The version in vcpkg is currently 19.16-1 and it is built with full CUDA support.
Hope this helps others..
You can use vcpkg to install dlib.
If you don't have vcpkg, you can get it here (Read Quick Start)
After you got vcpkg, run:
vcpkg install dlib:x64-windows
I have recently installed dlib on python 3.7.
First I have installed cmake from anaconda navigator (cmake version 3.14.0)
Next i installed visual studio 2019 and installed Desktop development with C++ .
Then I do pip install dlib and now its working
None of the answers worked for me. This is what worked
Assuming you have anaconda python 3.7 installed
1) Dowload and install cmake(make sure to check the option to add cmake to system path during installation to avoid manually doing later)
Download from this link cmake download
2) conda install -c conda-forge dlib
It is basically a two-step process:
install cmap
pip install cmap
install dlib
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
If you're trying to install dlib on Windows 10 with Visual Studio 2019, then first perform:
pip install cmake
And set it in the environment variable. After that, make sure that you have the latest version of Visual Studio SDK installed. After that, perform:
pip install dlib
I hope this solves the problem
Update/Install Visual C++
Maybe try installing/updating Visual C++. Because this is necessary for CMake to run. You can install it from here, https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15#
Installation with Wheel File
Run this:
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
Installation from Internet
Install CMake from https://cmake.org/download/
Run this,
set PATH="%PATH%;C:\Program Files\CMake\bin
to add CMake to your path. You can also do this manually by Editing The Environment Variables.
3)Download the following,
https://pypi.org/project/dlib/#files.
In the specified folder in which you extracted the install files run the following,
python setup.py install.
Simple and 100% working trick
(Make sure you install cmake)
My Anaconda python ver : 3.6.8 (64 bit) | OS :Windows 10
python -m pip install https://files.pythonhosted.org/packages/0e/ce/f8a3cff33ac03a8219768f0694c5d703c8e037e6aba2e865f9bae22ed63c/dlib-19.8.1-cp36-cp36m-win_amd64.whl#sha256=794994fa2c54e7776659fddb148363a5556468a6d5d46be8dad311722d54bfcf
Install dlib in Windows
download dlib from https://github.com/davisking/dlib.git
download camke from https://cmake.org/download/
Extract cmake and configure it as Environment variable to the extracted path my it was C:\Users\admin\Downloads\cmake-3.8.1-win32-x86\cmake-3.8.1-win32-x86\bin
Now extract dlib zip file and go to dlib folder
Follow this commands
cd dlib/test
mkdir build
cd build
cmake ..
cmake --build . --config Release
Now go to Release folder which would be at dlib\test\build\Release and execute this command
dtest.exe --runall
This process takes time as cmake compiles all C++ files so stay clam.
Enjoy!!!

Installing NumPy and SciPy on 64-bit Windows (with Pip)

I found out that it's impossible to install NumPy/SciPy via installers on Windows 64-bit, that's only possible on 32-bit. Because I need more memory than a 32-bit installation gives me, I need the 64-bit version of everything.
I tried to install everything via Pip and most things worked. But when I came to SciPy, it complained about missing a Fortran compiler. So I installed Fortran via MinGW/MSYS. But you can't install SciPy right away after that, you need to reinstall NumPy. So I tried that, but now it doesn't work anymore via Pip nor via easy_install. Both give these errors:
There are a lot of errors about LNK2019 and LNK1120,.
I get a lot of errors in the range of C: C2065,C2054,C2085,C2143`, etc. They belong together I believe.
There is no Fortran linker found, but I have no idea how to install that, can't find anything on it.
And many more errors which are already out of the visible part of my cmd-windows...
The fatal error is about LNK1120:
build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd : fatal error LNK1120: 7 unresolved externals
error: Setup script exited with error: Command "C:\Users\me\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\BLAS /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild\amd64 /LIBPATH:build\temp.win-amd64-2.7 lapack.lib blas.lib /EXPORT:initlapack_lite build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_litemodule.obj /OUT:build\lib.win-amd64-2.7\numpy\linalg\lapack_lite.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\numpy\linalg\lapack_lite.pyd.manifest" failed with exit status 1120
What is the correct way to install the 64-bit versions NumPy and SciPy on a 64-bit Windows machine? Did I miss anything? Do I need to specify something somewhere? There is no information for Windows on these problems that I can find, only for Linux or Mac OS X, but they don't help me as I can't use their commands.
You can install scipy and numpy using their wheels.
First install wheel package if it's already not there...
pip install wheel
Just select the package you want from http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
Example: if you're running python3.5 32 bit on Windows choose scipy-0.18.1-cp35-cp35m-win_amd64.whl then it will automatically download.
Then go to the command line and change the directory to the downloads folder and install the above wheel using pip.
Example:
cd C:\Users\[user]\Downloads
pip install scipy-0.18.1-cp35-cp35m-win_amd64.whl
EDIT: The Numpy project now provides pre-compiled packages in the wheel format (package format enabling compiled code as binary in packages), so the installation is now as easy as with other packages.
Numpy (as also some other packages like Scipy, Pandas etc.) includes lot's of C-, Cython, and Fortran code that needs to be compiled properly, before you can use it. This is, btw, also the reason why these Python-packages provide such fast Linear Algebra.
To get precompiled packages for Windows, have a look at Gohlke's Unofficial Windows Binaries or use a distribution like Winpython (just works) or Anaconda (more complex) which provide an entire preconfigured environment with lots of packages from the scientific python stack.
Installing with pip
You can install the numpy and scipy wheels on Windows with pip in one step if you use the appropriate link from Gohlke's Unofficial Windows Binaries (mentioned by sebix) and run the Windows command prompt as Administrator. For example, in Python 3.5, you would simply use something like this:
# numpy-1.9.3+mkl for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/numpy-1.9.3+mkl-cp35-none-win_amd64.whl
# scipy-0.16.1 for Python 3.5 on Win AMD64
pip3.5 install http://www.lfd.uci.edu/~gohlke/pythonlibs/xmshzit7/scipy-0.16.1-cp35-none-win_amd64.whl
Best solution for this is to download and install VCforPython2.7 from https://www.microsoft.com/en-us/download/details.aspx?id=44266
Then try pip install numpy
Downloading the binaries for 64-bit from http://www.lfd.uci.edu/~gohlke/pythonlibs/, and installing it directly with pip in this order:
pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl
Note that you must place command prompt in the folder where you put the .whl files after downloading them, and you must run it as administrator,
worked for me on Windows 10 64-bit now python is up and running.
You can now pip install numpy on Windows!
"Note: this page has only historical relevance, you can now pip-install for windows"
Source: https://github.com/numpy/numpy/wiki/Whats-with-Windows-builds
Intel provides pre-compiled Python modules for free in their "Intel Distribution for Python". The modules are compiled against Intel's MKL (Math Kernel Library) and thus optimized for faster performance. The package includes NumPy, SciPy, scikit-learn, pandas, matplotlib, Numba, tbb, pyDAAL, Jupyter, and others. Find more information and the download link here
If you are on windows , you wouldn't need wheel anyway! You can directly install package by downloading the 32-bit package as win32 from this link [http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy] and then move that downloaded package to cmd's current directory and open cmd and write following codepip install numpy-1.13.1+mkl-cp36-cp36m-win32.whl then do it same for scipy
For 64-bit you need to install mingw-w64 as it is gcc and compiles numpy and scipy as precompiled status.
Currently it works fine with 32-bit.So I had opted for win32 package both for numpy+mkl and scipy in that link.
Hope This works! Give a try
You can download the needed packages from here and use pip install "Abc.whl" from the directory where you have downloaded the file.
Look into python wheels to solve your problem. The best part of python wheels is that they let you install C extensions with no compilers. I just installed numpy and scipy using pip in a clean python install and they both worked fine.
for python 3.6, the following worked for me
launch cmd.exe as administrator
pip install numpy-1.13.0+mkl-cp36-cp36m-win32
pip install scipy-0.19.1-cp36-cp36m-win32
Package version are very important.
I found some stable combination that works on my Windows10 64 bit machine:
pip install numpy-1.12.0+mkl-cp36-cp36m-win64.whl
pip install scipy-0.18.1-cp36-cp36m-win64.whl
pip install matplotlib-2.0.0-cp36-cp36m-win64.whl
Source.
Hey I had the same issue.
You can find all the packages in the link below:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#scikit-learn
And choose the package you need for your version of windows and python.
You have to download the file with whl extension. After that, you will copy the file into your python directory then run the following command:
py -3.6 -m pip install matplotlib-2.1.0-cp36-cp36m-win_amd64.whl
Here is an example when I wanted to install matplolib for my python 3.6 https://www.youtube.com/watch?v=MzV4N4XUvYc
and this is the video I followed.
Follow these steps:
Open CMD as administrator
Enter this command : cd..
cd..
cd Program Files\Python38\Scripts
Download the package you want and put it in Python38\Scripts folder.
pip install packagename.whl
Done
You can write your python version instead of "38"

Categories