How do I install PIL/Pillow for Python 3.6? - python-3.x

I have a script that requires PIL to run. Other than downgrading my Python, I couldn't find anyway to install PIL on my Python 3.6
Here are my attempts:
pip install pil
Collecting pil
Could not find a version that satisfies the requirement pil (from versions: )
No matching distribution found for pil
pip install Pillow
Collecting Pillow
Using cached Pillow-3.3.1.zip
Installing collected packages: Pillow
Running setup.py install for Pillow ... error
Complete output from command c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile:
Single threaded build for windows
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\PIL
copying PIL\......................
..................................
..................................
running egg_info
writing Pillow.egg-info\PKG-INFO
writing dependency_links to Pillow.egg-info\dependency_links.txt
writing top-level names to Pillow.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.sh'
no previously-included directories found matching 'docs\_static'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching 'appveyor.yml'
warning: no previously-included files found matching 'build_children.sh'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -> build\lib.win-amd64-3.6\PIL
running build_ext
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 753, in <module>
zip_safe=not debug_build(), )
File "c:\python\python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\python\python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\python\python36\lib\distutils\command\install.py", line 539, in run
self.run_command('build')
File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\python\python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\python\python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\python\python36\lib\distutils\command\build_ext.py", line 338, in run
self.build_extensions()
File "C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\setup.py", line 521, in build_extensions
' using --disable-%s, aborting' % (f, f))
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting
----------------------------------------
Command "c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\ABDULR~1\\AppData\\Local\\Temp\\pip-build-rez5zpri\\Pillow\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\ABDULR~1\AppData\Local\Temp\pip-a5bugnjo-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ABDULR~1\AppData\Local\Temp\pip-build-rez5zpri\Pillow\
Didn't know to add argument --disable-zlib, pip install Pillow --disable-zlib wasn't correct.
Couldn't find what matches my system here: https://pypi.python.org/pypi/Pillow/3.0.0
64-bit Windows 10 & Python 3.6

For python version 2.x you can simply use
pip install pillow
But for python version 3.X you need to specify
(sudo) pip3 install pillow
when you enter pip in bash hit tab and you will see what options you have

You can download the wheel corresponding to your configuration here ("Pillow‑4.1.1‑cp36‑cp36m‑win_amd64.whl" in your case) and install it with:
pip install some-package.whl
If you have problem to install the wheel read this answer

Pillow is released with installation wheels on Windows:
We provide Pillow binaries for Windows
compiled for the matrix of supported Pythons
in both 32 and 64-bit versions in wheel, egg,
and executable installers. These binaries have
all of the optional libraries included
https://pillow.readthedocs.io/en/3.3.x/installation.html#basic-installation
Update: Python 3.6 is now supported by Pillow. Install with pip install pillow and check https://pillow.readthedocs.io/en/latest/installation.html for more information.
However, Python 3.6 is still in alpha and not officially supported yet, although the tests do all pass for the nightly Python builds (currently 3.6a4).
https://travis-ci.org/python-pillow/Pillow/jobs/155605577
If it's somehow possible to install the 3.5 wheel for 3.6, that's your best bet. Otherwise, zlib notwithstanding, you'll need to build from source, requiring an MS Visual C++ compiler, and which isn't straightforward. For tips see:
https://pillow.readthedocs.io/en/3.3.x/installation.html#building-from-source
And also see how it's built for Windows on AppVeyor CI (but not yet 3.5 or 3.6):
https://github.com/python-pillow/Pillow/tree/master/winbuild
Failing that, downgrade to Python 3.5 or wait until 3.6 is supported by Pillow, probably closer to the 3.6's official release.

In Windows 10 for those struggling to install PIL/pillow while coding on PyCharm and have Python 3.10.6 proceed as follows;
Close PyCharm IDE Open and Run CMD.exe prompt as Administrator
In CMD prompt, run pip3 install pillow
After pillow is installed, close CMD prompt
Open PyCharm IDE and you will see that you can now import PIL

Related

Installing pygame fails on local file [duplicate]

This question already has answers here:
Cannot install pygame in Pycharm
(1 answer)
pycharm doesn't recognize pygame package
(2 answers)
Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'dir:\projectPath\venv\Scripts\python.exe'
(8 answers)
Closed 2 years ago.
I am trying for a while now to install pygame into my Project but whatever I try is doesn’t work. The real frustrating part is that I managed to do it in the past. Witch might be the problem, but I am getting ahead of myself.
Environment:
Python 3.8
Windows 10
I use PyCharm
pip install pygame
i get:
Collecting pygame
Using cached
https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441
db2be/pygame-1.9.6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x64"? [Y/n]Traceback (most
recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\setup.py", line 194, in
<module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\buildconfig\config.py", line
210, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-la9vy5w2\pygame\buildconfig\config_win.py",
line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-
la9vy5w2\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-
install-la9vy5w2\pygame\
I fould someone else who had the sme problem here:
Pip Install EOFError
and also:
Unable to install pygame on Python 3.8 via pip (Windows 10)
So I tried:
pip install pygame==2.0.0.dev6
I got:
Collecting pygame==2.0.0.dev6
Using cached
https://files.pythonhosted.org/packages/c5/a0/63f9ca836e6a08e560f1ef3f2535ffb46bfdad2abb093dd097dae25
2be28/pygame-2.0.0.dev6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\setup.py", line 258, in
<module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\config.py", line
208, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\buildconfig\download_win_prebuilt.py", line 17, in download_sha1_unzip
import requests
ModuleNotFoundError: No module named 'requests'
Making dir :prebuilt_downloads:
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-install-uf_w85qw\pygame\
I also tried some other stuff, like updating pip, but in the end I ended up with the same error message again. (If us want to see the full log just say it and I will upload the other 2 pages of error message.)
Am I right in my assumption that pip tries to install the game from a local file and that file is somehow corrupted or something?
If so how can I make pip install the packed form the Internet?
If not what is the problem?
I can even life with some weird solution like coping a entire project including its packages. (ok that would bug me a little, but as long as it works ...)
Since it was suggested to me I tried
pip install requests
in a new project:
Collecting requests
Using cached
https://files.pythonhosted.org/packages/45/1e/0c169c6a5381e241ba7404532c16a21d86ab872c9bed8bdcd4c423954103/requests-2.24.0-py2.py3-none-any.whl
Collecting chardet<4,>=3.0.2 (from requests)
Using cached
https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached
https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting idna<3,>=2.5 (from requests)
Using cached
https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
Using cached
https://files.pythonhosted.org/packages/9f/f0/a391d1463ebb1b233795cabfc0ef38d3db4442339de68f847026199e69d7/urllib3-1.25.10-py2.py3-none-any.whl
Installing collected packages: chardet, certifi, idna, urllib3, requests
Successfully installed certifi-2020.6.20 chardet-3.0.4 idna-2.10 requests-2.24.0 urllib3-1.25.10
and than:
pip install pygame==2.0.0.dev6
leading to:
Collecting pygame==2.0.0.dev6
Using cached https://files.pythonhosted.org/packages/c5/a0/63f9ca836e6a08e560f1ef3f2535ffb46bfdad2abb093dd097dae252be28/pygame-2.0.0.dev6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\setup.py", line 258, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\config.py", line 208, in main
deps = CFG.main(**kwds)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\config_win.py", line 559, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 269, in ask
update(x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 252, in update
download_prebuilts(download_dir, x86=x86, x64=x64, sdl2=sdl2)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 101, in download_prebuilts
download_sha1_unzip(url, checksum, temp_dir, 1)
File "C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\buildconfig\download_win_prebuilt.py", line 37, in download_sha1_unzip
raise ValueError(
ValueError: url:https://bitbucket.org/llindstrom/pygame/downloads/prebuilt-x64-pygame-1.9.2-20150922.zip should have checksum:3a5af3427b3aa13a0aaf5c4cb08daaed341613ed: Has:9571d3c5ad8347afb0b101bc242ef5da1a46bb11:
Making dir :prebuilt_downloads:
Downloading... https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip 0bbac0106358dc99b8ba2401ae6a1c10d3927ca9
Unzipping :prebuilt_downloads\SDL2-devel-2.0.10-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.5-VC.zip 137f86474691f4e12e76e07d58d5920c8d844d5b
Unzipping :prebuilt_downloads\SDL2_image-devel-2.0.5-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.14-VC.zip c64d90c1f7d1bb3f3dcfcc255074611f017cdcc4
Unzipping :prebuilt_downloads\SDL2_ttf-devel-2.0.14-VC.zip:
Downloading... https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-VC.zip 9097148f4529cf19f805ccd007618dec280f0ecc
Unzipping :prebuilt_downloads\SDL2_mixer-devel-2.0.4-VC.zip:
Downloading... https://www.ijg.org/files/jpegsr9c.zip 9ca086c960ffc4bff821ba194c8d0a15f69eae09
Unzipping :prebuilt_downloads\jpegsr9c.zip:
Downloading... https://bitbucket.org/llindstrom/pygame/downloads/prebuilt-x64-pygame-1.9.2-20150922.zip 3a5af3427b3aa13a0aaf5c4cb08daaed341613ed
---
For help with compilation see:
https://www.pygame.org/wiki/CompileWindows
To contribute to pygame development see:
https://www.pygame.org/contribute.html
---
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
C:\Users\User\AppData\Local\Temp\pip-install-ccq77zry\pygame\
here:
https://github.com/googleapis/google-cloud-python/issues/3884
I found the advice to use:
pip install --upgrade setuptools
witch lead to:
Collecting setuptools
Downloading
https://files.pythonhosted.org/packages/6d/ed/52e05469314a266f68d9f251a8c1ab7a21a03327b1724056e3eea654bfd1/setuptools-50.0.3-py3-none-any.whl (784kB)
100% |████████████████████████████████| 788kB 1.2MB/s
Installing collected packages: setuptools
Found existing installation: setuptools 40.8.0
Uninstalling setuptools-40.8.0:
Could not install packages due to an EnvironmentError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: 'd:\\workspace\\pycharmprojects\\libs5\\testproject\\venv\\lib\\site-packages\\setuptools-40.8.0-py3.8
.egg'
Consider using the `--user` option or check the permissions.
so i tried:
pip install --upgrade setuptools --user
witch worked:
Collecting setuptools
Using cached
https://files.pythonhosted.org/packages/6d/ed/52e05469314a266f68d9f251a8c1ab7a21a03327b1724056e3eea654bfd1/setuptools-50.0.3-py3-none-any.whl
Installing collected packages: setuptools
Successfully installed setuptools-50.0.3
sadly this did not change the Error message.

Not able to install dlib on Windows 10 and Python 3.7

I am trying to install OpenCV, dlib on Windows 10 on Anaconda Python 3.7.
I have installed Visual studio 2015 as prerequisite along with CMake. When I am trying to install dlib on my computer it is giving me below error. I am also not able to install OpenCV. I tried installing the dlib using .whl file. But, still no luck.
Collecting dlib
Using cached https://files.pythonhosted.org/packages/1e/62/aacb236d21fbd08148b1d517d58a9d80ea31bdcd386d26f21f8b23b1eb28/dlib-19.18.0.tar.gz
Building wheels for collected packages: dlib
Building wheel for dlib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\dbi227\AppData\Local\Temp\pip-wheel-2nm313mu' --python-tag cp37
cwd: C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\
Complete output (73 lines):
running bdist_wheel
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17763.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/23/2019 9:27:01 AM.
Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.51
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/dbi227/AppData/Local/Temp/pip-install-9vjrsx_l/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\wheel\bdist_wheel.py", line 192, in run
self.run_command('build')
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\dbi227\\AppData\\Local\\Continuum\\anaconda3\\envs\\opencv-env\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Failed building wheel for dlib
Running setup.py clean for dlib
Failed to build dlib
Installing collected packages: dlib
Running setup.py install for dlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\dbi227\AppData\Local\Temp\pip-record-3ic8n66v\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\
Complete output (75 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Building extension for Python 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\lib.win-amd64-3.7 -A x64'
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17763.
CMake Error at CMakeLists.txt:3 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 10/23/2019 9:27:03 AM.
Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj" (default target) (1) ->
(Desktop_PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\x64\PlatformToolsets\v140\Toolset.targets(36,5): error MSB8036: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution". [C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\build\temp.win-amd64-3.7\Release\CMakeFiles\3.15.3\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.10
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/dbi227/AppData/Local/Temp/pip-install-9vjrsx_l/dlib/build/temp.win-amd64-3.7/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 261, in <module>
'Topic :: Software Development',
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\dbi227\AppData\Local\Temp\pip-install-9vjrsx_l\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-DPYTHON_EXECUTABLE=C:\\Users\\dbi227\\AppData\\Local\\Continuum\\anaconda3\\envs\\opencv-env\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\build\\lib.win-amd64-3.7', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\dbi227\AppData\Local\Continuum\anaconda3\envs\opencv-env\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\dbi227\\AppData\\Local\\Temp\\pip-install-9vjrsx_l\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\dbi227\AppData\Local\Temp\pip-record-3ic8n66v\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
I had the problem with anaconda channel for this package. Current version from anaconda requires Python <=3.6.
I used pip channel instead of anaconda. By
pip install dlib
Before installing via pip, please make sure that you are using current environments pip by
which pip
This should output something like /home/user_name/anaconda3/envs/env_name/bin/pip
I tried so many things to work with the latest version of Anaconda which is Python 3.7. However, I was unable to do so. Because none of the .whl file were compatible with Python 3.7, but with Python 3.6. So, I followed the link to downgrade the Python version to 3.6. This way spyder as well as Python would be downgraded to the 3.6 version. Once I had done so, I installed OpenCV using the below commands.
pip install opencv-python
pip install opencv-contrib-python
I installed dlib using the following command.
pip install dlib-19.8.1-cp36-cp36m-win_amd64.whl
This successfully installed the latest version of dlib.
To check if everything got installed properly, the commands I used and the output I got on Anaconda prompt was as follows.
(py36) C:\Users\dbi227> python
Python 3.6.9 |Anaconda, Inc.| (default, Jul 30 2019, 14:00:49) [MSC v.1915 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'4.1.1'
>>> import dlib
>>> dlib.__version__
'19.8.1'
It is important to check if your iPython installation is also downgraded to 3.6 or not. For that, I got an option spyder(py36) apart from spyder(anaconda3) on my start option. Make sure you click on spyder(py36). Because that is the one where the libraries are installed. To check it, you can just type:
import cv2
import dlib
If these commands do not show any error, then the libraries are correctly installed.
You need to compile it. Install Visual Studio 2019 and CMake.
Then go to folder of your dlib, open the terminal and use the command
python3 setup.py sdist bdist_wheel
It will load lots of text, and then you will have a wheel file in your dist folder. Make sure your Python 3.7.2 corresponds to the dlib version.
In the end, all you need to do is pip install cp37.whl
No need to downgrade Python to 3.6.x
The best way to do it on Windows (if you find installing all the huge Visual Studio just to build dlib is too much overkill -- I feel so), is to create another environment in conda then install dlib. Why? Because we'll need prebuilt wheel (whl) file for Windows with:
conda install -c conda-forge dlib
and that trigger a environment checking/dependency checking, etc, packages will be upgraded/downgraded/removed/etc., and will pretty much likely will have unwanted impact to your base environment. So creating environment will save you from headaches when we have packages conflict. conda will manage the dependencies for you.
You can install dlib through one of .whl files available here: https://pypi.org/simple/dlib/
For example, if you want to install dlib for Windows 64 bit version and for Python 3.6 then download this dlib-19.8.1-cp36-cp36m-win_amd64.whl
and install it
using
pip3 install dlib-19.8.1-cp36-cp36m-win_amd64.whl
Note: Please verify the Python version and Operating system accordingly.

Error installing dlib in windows 10

I can't seem to install dlib on my windows 10 machine using pip.
I am using python 3.6.1
i did try pip installing dlib using the following commands
pip install dlib
but it returns me with the following error.
Collecting dlib
Using cached dlib-19.10.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib ... error
Complete output from command c:\users\ayush\appdata\local\programs\python \python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Ayush\AppData\Local\Temp\pip-uhnfkgpd-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6 -DPYTHON_EXECUTABLE=c:\users\ayush\appdata\local\programs\python\python36-32\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\build\lib.win32-3.6'
-- Building for: NMake Makefiles
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
The CMAKE_C_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error in CMakeLists.txt:
The CMAKE_CXX_COMPILER:
cl
is not a full path and was not found in the PATH.
To use the NMake generator with Visual C++, cmake must be run from a shell
that can use the compiler cl from the command line. This environment is
unable to invoke the cl compiler. To fix this problem, run cmake from the
Visual Studio Command Prompt (vcvarsall.bat).
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Ayush/AppData/Local/Temp/pip-build-iu6_cvvs/dlib/build/temp.win32-3.6/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 249, in <module>
'Topic :: Software Development',
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 129, in run
self.build_extension(ext)
File "C:\Users\Ayush\AppData\Local\Temp\pip-build-iu6_cvvs\dlib\setup.py", line 163, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "c:\users\ayush\appdata\local\programs\python\python36-32\lib\subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6', '-DPYTHON_EXECUTABLE=c:\\users\\ayush\\appdata\\local\\programs\\python\\python36-32\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Ayush\\AppData\\Local\\Temp\\pip-build-iu6_cvvs\\dlib\\build\\lib.win32-3.6']' returned non-zero exit status 1.
i have Cmake installed and i also tried setting a environmental variable path to the Cmake library but the same error occurs.

Clarifai installation error : Visual C++ Build Tools + access denied

Hye guys , I kinda got stucked when i tried to install the clarifai library
py -m pip install clarifai --upgrade
when I enter that command into cmd i get this error:
reading manifest file 'Pillow.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'Pillow.egg-info\SOURCES.txt'
copying PIL\OleFileIO-README.md -> build\lib.win-amd64-3.6\PIL
running build_ext
building 'PIL._imaging' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Rolling back uninstall of pillow
Command ""C:\Program Files\Python36\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\StyleZ\\AppData\\Local\\Temp\\pip-build-saobo9i2\\Pillow\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\StyleZ\AppData\Local\Temp\pip-aya2mngc-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\StyleZ\AppData\Local\Temp\pip-build-saobo9i2\Pillow\
I have installed the build tools and this an error i get from a console there :
Installing collected packages: Pillow, clarifai
Found existing installation: pillow 5.0.0
Uninstalling pillow-5.0.0:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\shutil.py", line 544, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python36\\lib\\site-packages\\pil\\__init__.py' -> 'C:\\Users\\StyleZ\\AppData\\Local\\Temp\\pip-4n872yw7-uninstall\\program files\\python36\\lib\\site-packages\\pil\\__init__.py'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Program Files\Python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_set.py", line 778, in install
requirement.uninstall(auto_confirm=True)
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:\Program Files\Python36\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
renames(path, new_path)
File "C:\Program Files\Python36\lib\site-packages\pip\utils\__init__.py", line 267, in renames
shutil.move(old, new)
File "C:\Program Files\Python36\lib\shutil.py", line 559, in move
os.unlink(src)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python36\\lib\\site-packages\\pil\\__init__.py'
I was trying multiple things ... but as I noticed in second console I dont have a permissions , while the programm is running as admin and at a same time I have only 1 user and thats this admin ...
Any idea how to fix it ?
okey I found out how to fix this :) if somone is wondering
py -m pip install clarifai --upgrade
needs to be changed to :
python -m pip install clarifai
also dont forget to run it as an Admin

pip install PySide fails

I am using both Python 2 and Python 3. I am trying to make pylab variation of ipython work on Python 3 (as it works well enough on Python 2).
After failing to install PyQt4, I have tried installing PySide install, using the following pip command:
sudo pip -vvv install --upgrade pyside
It took a while. My computer got fairly hot, also. But after reaching 100%, the installation failed with the following error message:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-o8v5e0ej/pyside/setup.py", line 1001, in <module>
ext_package = 'PySide',
File "/usr/lib/python3.4/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.4/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.4/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-o8v5e0ej/pyside/setup.py", line 245, in run
raise RuntimeError("Can't find '%s'" % (filename,))
RuntimeError: Can't find '/usr/bin/pyside_postinstall.py'
----------------------------------------
Cleaning up...
Removing source in /tmp/pip-build-o8v5e0ej/pyside [85/929]
Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-o8v5e0ej/pyside/setup.py';exec(compile(getattr(tokenize, 'open', open)(__fil
e__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1z4uq1n8-record/install-record.txt --single-version-externally-managed --compi
le" failed with error code 1 in /tmp/pip-build-o8v5e0ej/pyside
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python3.4/dist-packages/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/usr/local/lib/python3.4/dist-packages/pip/commands/install.py", line 299, in run
root=options.root_path,
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_set.py", line 646, in install
**kwargs
File "/usr/local/lib/python3.4/dist-packages/pip/req/req_install.py", line 862, in install
show_stdout=False,
File "/usr/local/lib/python3.4/dist-packages/pip/utils/__init__.py", line 732, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "/usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-o8v5e0ej/pyside/setup.py';exec(compile(get
attr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-1z4uq1n8-record/install-record.txt --single-
version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-o8v5e0ej/pyside
So all in all, it did not help me with pylab. Running ipython --pylab raises
ImportError: libpyside.cpython-34m.so.1.2: cannot open shared object file: No such file or directory
This is a result of the line
from PySide import QtCore, QtGui, __version__, __version_info__
Have I done something wrong?
My system info:
Python 3.4.0
Ubuntu 14.04.3 LTS (trusty)
Architecture: 64 bit
Kernel version: 3.16.0-40-generic
I am not completely sure this is a proper answer to my question, as it does not really solve the problem with pip, but I have succeeded in solving the pylab issue on my machine, and this is what I've done:
I've purged (via aptitude) both python3-pyqt4 and python3-pyqt5
I've uninstalled (via pip) python pyside
I've installed (via aptitude) python3-pyside
Now ipython --pylab works (with Python 3.4.0).

Resources