I've been trying to work on a face recognition project, but when I try to install dlib in pycharm I get this error.
Collecting dlib
Using cached dlib-19.21.0.tar.gz (3.2 MB)
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
DEPRECATION: The -b/--build/--build-dir/--build-directory option is deprecated. pip 20.3 will remove support for this functionality. A possible replacement is use the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean. You can find discussion regarding this at https://github.com/pypa/pip/issues/8333.
ERROR: Command errored out with exit status 1:
command: 'C:\Users\Alexis\.virtualenvs\pythonProject\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\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\Alexis\AppData\Local\Temp\pip-record-kq4elzu2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Alexis\.virtualenvs\pythonProject\include\site\python3.9\dlib'
cwd: C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\
Complete output (77 lines):
running install
running build
running build_py
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Building extension for Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win-amd64-3.9 -DPYTHON_EXECUTABLE=C:\Users\Alexis\.virtualenvs\pythonProject\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\lib.win-amd64-3.9 -A x64'
-- Building for: Visual Studio 16 2019
-- Selecting Windows SDK version to target Windows 10.0.19041.
CMake Error at CMakeLists.txt:14 (project):
Failed to run MSBuild command:
MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 4.8.4084.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 11/1/2020 2:39:22 PM.
Project "C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\temp.win-amd64-3.9\Release\CMakeFiles\3.18.2\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\temp.win-amd64-3.9\Release\CMakeFiles\3.18.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\temp.win-amd64-3.9\Release\CMakeFiles\3.18.2\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\temp.win-amd64-3.9\Release\CMakeFiles\3.18.2\VCTargetsPath.vcxproj" (default target) (1) ->
C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\build\temp.win-amd64-3.9\Release\CMakeFiles\3.18.2\VCTargetsPath.vcxproj(14,2): error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.14
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/Alexis/AppData/Local/Temp/pycharm-packaging/dlib/build/temp.win-amd64-3.9/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 223, in <module>
setup(
File "C:\Users\Alexis\.virtualenvs\pythonProject\lib\site-packages\setuptools\__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Alexis\.virtualenvs\pythonProject\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 135, in run
self.build_extension(ext)
File "C:\Users\Alexis\AppData\Local\Temp\pycharm-packaging\dlib\setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Alexis\AppData\Local\Programs\Python\Python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win-amd64-3.9', '-DPYTHON_EXECUTABLE=C:\\Users\\Alexis\\.virtualenvs\\pythonProject\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\build\\lib.win-amd64-3.9', '-A', 'x64']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command errored out with exit status 1:
'C:\Users\Alexis\.virtualenvs\pythonProject\Scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Alexis\\AppData\\Local\\Temp\\pycharm-packaging\\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\Alexis\AppData\Local\Temp\pip-record-kq4elzu2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\Alexis\.virtualenvs\pythonProject\include\site\python3.9\dlib' Check the logs for full command output.
----------------------------------------------------------------------------
try pip install dlib --no-cache-dir if that doesn't work downgrade to python version 3.8.
I tried installing it on version 3.8 and it work fine.
Installed Pycharm
Windows 10
Python 3.8.3 (with pipenv, but should work with pip also)
ex: pipenv install (as virtual env)
since "pipenv install dlib" was giving installation errors after struggling for sometime, able to install the latest dlib library (dlib==19.20.0)
Below is the procedure which helped me to succeed in installing the latest dlib - we have to Manually compile the dlib for Python
Install visual studio (I installed Microsoft Visual Studio Community 2019 Version 16.6.3)
Make Sure to select Visual C++ Or C++ environment - complete the installation - Nothing else is needed (In Visual Studio 2019 go to the Individual Components tab, Visual C++ Tools for Cmake, and check the checkbox under the "Compilers, build tools and runtimes" section.)
Goto - https://cmake.org/download/ and download the cmake for 64bit (cmake-3.18.0-rc4-win64-x64.msi is what i installed)
When installing, make sure to add CMake to the system path (once installation is complete -> check that Environment variable to see this is present)
Goto https://pypi.org/project/dlib/ -> Click on "Download Files"
dlib-19.20.0.tar.gz (is what i had as latest) -> Download the same
extract the file "dlib-19.20.0.tar.gz" till you see the files (dlib, dlib.egg-info, python_examples, tools, MANIFEST.in, PKG-INFO, README.md setup.cfg, setup.py)
Copy all these files (select all (ctrl+a)and copy(ctrl+c)) -> Make sure to copy only these files and not its parent directory along
Goto site-packages in python installation (C:\Users\AppData\Local\Programs\Python\Python38\Lib\site-packages)
Paste all the files copied in step 7,8
open command prompt and goto -> C:\Users\AppData\Local\Programs\Python\Python38\Lib\site-packages
execute command -> python setup.py install
Thats all you should be done - it might take 5 - 10 mins to complete the process, you should see something like below in the end Installed c:\users\appdata\local\programs\python\python38\lib\site-packages\dlib-19.20.0-py3.8-win-amd64.egg Processing dependencies for dlib==19.20.0 Finished processing dependencies for dlib==19.20.0
Related
This is my first question on here. Thank you very much in advance for your support.
I'm using Python 3.9.1 on a 64-bit Windows 10 machine and I've been trying to install the tables package by pip install tables but I always got the following error:
pip install tables
Collecting tables
Using cached tables-3.6.1.tar.gz (4.6 MB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\acer\appdata\local\programs\python\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-u9bkjlwp\\tables_8a3121807beb4fde8d73782dff1f349e\\setup.py'"'"'; __file__='"'"'C:\\Users\\Acer\\AppData\\Local\\Temp\\pip-install-u9bkjlwp\\tables_8a3121807beb4fde8d73782dff1f349e\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Acer\AppData\Local\Temp\pip-pip-egg-info-9_t31x9b'
cwd: C:\Users\Acer\AppData\Local\Temp\pip-install-u9bkjlwp\tables_8a3121807beb4fde8d73782dff1f349e\
Complete output (17 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Acer\AppData\Local\Temp\pip-install-u9bkjlwp\tables_8a3121807beb4fde8d73782dff1f349e\setup.py", line 634, in <module>
libdir = compiler.has_function(package.target_function,
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\ccompiler.py", line 792, in has_function
objects = self.compile([fname], include_dirs=include_dirs)
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\_msvccompiler.py", line 323, in compile
self.initialize()
File "c:\users\acer\appdata\local\programs\python\python39\lib\distutils\_msvccompiler.py", line 220, in initialize
vc_env = _get_vc_env(plat_spec)
File "c:\users\acer\appdata\local\programs\python\python39\lib\site-packages\setuptools\msvc.py", line 313, in msvc14_get_vc_env
return _msvc14_get_vc_env(plat_spec)
File "c:\users\acer\appdata\local\programs\python\python39\lib\site-packages\setuptools\msvc.py", line 267, in _msvc14_get_vc_env
raise distutils.errors.DistutilsPlatformError(
distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
* Using Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)]
* USE_PKGCONFIG: False
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2b/32/847ee3f521aae6a0be380d923a736162d698586f444df1ac24b98c65025c/tables-3.6.1.tar.gz#sha256=49a972b8a7c27a8a173aeb05f67acb45fe608b64cd8e9fa667c0962a60b71b49 (from https://pypi.org/simple/tables/) (requires-python:>=3.5). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
I don't understand the error message but I suspect that it has to do with my Python version.
I did install all the prerequisite packages suggested on the tables' homepage but I still got the error while installing the tables package.
I also tried to install with .whl file, too but there was no file with cp39 in its name (which led me to the conclusion that there's no compatible version for Python 3.9 yet, but I might be wrong.)
Is there a way to install tables with Python 3.9.1? Thank you very much.
I've downloaded and installed the tables-3.6.1-cp39-cp39-win_amd64.whl from this unofficial Windows binaries archive
Installed it with pip install tables-3.6.1-cp39-cp39-win_amd64.whl
update
The package was removed from the above link. I've found another source:
pypi.bartbroe.re/tables/
Installing numba and llvmlite Python on Windows 10 failure
I have tried to install Python numba on Windows 10 using
pip install numba
with partial success, but a failure installing llvmlite
Requirement already satisfied: numpy>=1.15 in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (1.19.2+mkl)
Requirement already satisfied: setuptools in c:\users\paul\appdata\local\programs\python\python39\lib\site-packages (from numba) (49.2.1)
Building wheels for collected packages: numba, llvmlite
Building wheel for numba (setup.py) ... done
Created wheel for numba: filename=numba-0.51.2-cp39-cp39-win_amd64.whl size=2173229 sha256=249a12f2e1436ac244e2730f6e7ddb5bd53413460dcbdc4ed4e6aeebbf16d6ce
Stored in directory: c:\users\paul\appdata\local\pip\cache\wheels\0a\51\41\9f5a61bcd9d25271d7021e05cbabcd574fb3d534d07654b780
Building wheel for llvmlite (setup.py) ... error
ERROR: Command errored out with exit status 1:
CMake Error at CMakeLists.txt:9 (find_package):
Could not find a package configuration file provided by "LLVM" with any of
the following names:
LLVMConfig.cmake
llvm-config.cmake
Add the installation prefix of "LLVM" to CMAKE_PREFIX_PATH or set
"LLVM_DIR" to a directory containing one of the above files. If "LLVM"
provides a separate development package or SDK, be sure it has been installed.
-- Configuring incomplete, errors occurred!
Doesn't know where LLVM is installed?
So I used Windows Environment editor to add LLVM_DIR with value C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\llvm
in the hope that it will use one of the four Clang versions that I have installed at C:\LLVM\clang-1100, C:\LLVM\clang-1000 ...
latest binary is C:\LLVM\clang-1100\LLVM\bin
I also have VS 1017 and 1019 installed, and all compilers are working OK from other IDEs and builds.
and downloaded the most recent wheel
llvmlite-0.34.0-cp39-cp39-win_amd64.whl
and added LLVM_DIR to system PATH
C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64\lib\cmake\llvm
This allows it to more nearly work, but fails using MSVC
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\ZERO_CHECK.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
LINK : fatal error LNK1181: cannot open input file 'D:\winlibs64_stage\custombuilt\lib\libffi.dll.a' [C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build\llvmlite.vcxproj]
Trying generator 'Visual Studio 15 2017 Win64'
Traceback (most recent call last):
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 191, in <module>
main()
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 179, in main
main_win32()
File "C:\Users\Paul\AppData\Local\Temp\pip-install-xvvf77_z\llvmlite\ffi\build.py", line 94, in main_win32
subprocess.check_call(['cmake', '--build', build_dir, '--config', config])
File "c:\users\paul\appdata\local\programs\python\python39\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', 'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\ffi\\build', '--config', 'Release']' returned non-zero exit status 1.
error: command 'c:\\users\\paul\\appdata\\local\\programs\\python\\python39\\python.exe' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\paul\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\setup.py'"'"'; __file__='"'"'C:\\Users\\Paul\\AppData\\Local\\Temp\\pip-install-xvvf77_z\\llvmlite\\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\Paul\AppData\Local\Temp\pip-record-l4absc_g\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\paul\appdata\local\programs\python\python39\Include\llvmlite' Check the logs for full command output.
This suggests that the output folder location is not specified, or that VS incremental build option is not set to 'not used'.
Or that I should use an LLVM version, but I don't know how to specify which one, and not use VS2017.
Suggestions how to get out of this rabbit hole most welcome ;-)
Thanks
Paul
I wanted to install librosa but I get stack with this error, but I managed to solve it with this:
first I download the last version of llvmlite Here
than I run the following command:
pip install llvmlite-0.35.0-cp39-cp39-win_amd64.whl
next for all packages need by librosa I install them as follow:
pip install --no-deps packageName
or just for more sample do as follow :
pip install librosa --ignore-installed llvmlite
I am trying to install a python package called osmium into a virtual environment that I created with venv. With the virtual environment activated and from the Scripts directory of the virtual environment, calling
pip install osmium
fails (error message below). I am using pycharm as an IDE. Attempting to install osmium via the IDE also fails.
Interestingly, I have a colleague with the identical computer and identical versions of python and pycharm who succeeded in installing osmium. He relied directly on the virtual environment created by pycharm (which, I think, uses virtualenv instead of venv), never using venv and had no problem.
I even went as far as reinstalling both python and pycharm to no avail. I wonder what's going on here. Why is this happening in the first place? And what is causing the failure even after reinstalling (do some traces of python and pycharm remain?)
The error message is:
D:\virtual_envs\test_env\Scripts>activate
(test_env) D:\virtual_envs\test_env\Scripts>pip install osmium
Collecting osmium
Using cached https://files.pythonhosted.org/packages/65/ec/41bc12a33bc9feab921e5e21999fe30882288f2f4f8d8a4536dcd03e2c0b/osmium-2.15.2.tar.gz
Installing collected packages: osmium
Running setup.py install for osmium ... error
Complete output from command d:\virtual_envs\test_env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium\\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\J84120~1\AppData\Local\Temp\pip-record-torhb0ih\install-record.txt --single-version-externally-managed --compile --install-headers d:\virtual_envs\test_env\include\site\python3.7\osmium:
running install
running build
running build_py
creating build
creating build\lib.win32-3.7
creating build\lib.win32-3.7\osmium
copying src\osmium\version.py -> build\lib.win32-3.7\osmium
copying src\osmium\__init__.py -> build\lib.win32-3.7\osmium
creating build\lib.win32-3.7\osmium\osm
copying src\osmium/osm\mutable.py -> build\lib.win32-3.7\osmium/osm
copying src\osmium/osm\__init__.py -> build\lib.win32-3.7\osmium/osm
creating build\lib.win32-3.7\osmium\replication
copying src\osmium/replication\server.py -> build\lib.win32-3.7\osmium/replication
copying src\osmium/replication\utils.py -> build\lib.win32-3.7\osmium/replication
copying src\osmium/replication\__init__.py -> build\lib.win32-3.7\osmium/replication
running build_ext
-- Building for: Visual Studio 14 2015
-- Selecting Windows SDK version to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Found Protozero: C:/Users/J84120841/AppData/Local/Temp/pip-install-3_44nlf3/osmium/contrib/protozero/include (found suitable version "1.6.7", minimum required is "1.5.1")
CMake Warning at cmake/FindOsmium.cmake:127 (message):
Osmium: Can not find some libraries for PBF input/output, please install
them or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
-- Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
CMake Warning at cmake/FindOsmium.cmake:153 (message):
Osmium: Can not find some libraries for XML input/output, please install
them or configure the paths.
Call Stack (most recent call first):
CMakeLists.txt:6 (find_package)
CMake Error at D:/virtual_envs/test_env/Lib/site-packages/cmake/data/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Osmium (missing: ZLIB_FOUND EXPAT_FOUND BZIP2_FOUND) (found
suitable version "2.15.1", minimum required is "2.14")
Call Stack (most recent call first):
D:/virtual_envs/test_env/Lib/site-packages/cmake/data/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake/FindOsmium.cmake:278 (find_package_handle_standard_args)
CMakeLists.txt:6 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/J84120841/AppData/Local/Temp/pip-install-3_44nlf3/osmium/build/temp.win32-3.7/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/J84120841/AppData/Local/Temp/pip-install-3_44nlf3/osmium/build/temp.win32-3.7/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\J84120~1\AppData\Local\Temp\pip-install-3_44nlf3\osmium\setup.py", line 150, in <module>
zip_safe=False,
File "d:\virtual_envs\test_env\lib\site-packages\setuptools\__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "d:\virtual_envs\test_env\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\J84120~1\AppData\Local\Temp\pip-install-3_44nlf3\osmium\setup.py", line 67, in run
self.build_extension(ext)
File "C:\Users\J84120~1\AppData\Local\Temp\pip-install-3_44nlf3\osmium\setup.py", line 110, in build_extension
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
File "C:\Users\J84120841\AppData\Local\Programs\Python\Python37-32\lib\subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\J84120~1
\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium\\build\\lib.win32-3.7', '-DPYTHON_EXECUTABLE=d:\\virtual_envs\\test_env\\scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium\\build\\lib.win32-3.7', '-DOSMIUM_INCLUDE_DIR=C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium/contrib/libosmium/include', '-DPROTOZERO_INCLUDE_DIR=C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium/contrib/protozero/include', '-DPYBIND11_PREFIX=C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium/contrib/pybind11']' returned non-zero exit status 1.
----------------------------------------
Command "d:\virtual_envs\test_env\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\J84120~1\\AppData\\Local\\Temp\\pip-install-3_44nlf3\\osmium\\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\J84120~1\AppData\Local\Temp\pip-record-torhb0ih\install-record.txt --single-version-externally-managed --compile --install-headers d:\virtual_envs\test_env\include\site\python3.7\osmium" failed with error code 1 in C:\Users\J84120~1\AppData\Local\Temp\pip-install-3_44nlf3\osmium\
You are using pip version 18.1, however version 19.1.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
(test_env) D:\virtual_envs\test_env\Scripts>
The problem lies in OS dependencies for development packages. From the documentation, you can get library names that you also see in your error message
sudo apt-get install build-essential cmake libboost-dev \
libexpat1-dev zlib1g-dev libbz2-dev
That command is for Debian-based distributions. So you have to find MS Windows versions
Bzip2
http://gnuwin32.sourceforge.net/packages/bzip2.htm
Zlib
http://gnuwin32.sourceforge.net/packages/zlib.htm
expat as NuGet package
https://www.nuget.org/api/v2/package/expat.v141/2.2.6
There is an option from ZeroC Ice for VisualStudio
Vpython versions are not available from their website, but according to https://groups.google.com/forum/#!topic/vpython-users/AmIZF2v4Wkc, "pip install vpython" should work for any version of Python.
I entered "pip install vpython" into the windows command prompt. After several minutes of downloading, pip gave me the following error:
Running setup.py install for vpnotebook ... error
Complete output from command c:\users\zachary\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Zachary\\AppData\\Local\\Temp\\pip-build-dx_wvbg0\\vpnotebook\\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\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt --single-version-externally-managed --compile:
ImportError install_kernel_spec
c:\users\zachary\appdata\local\programs\python\python36-32\lib\site-packages\setuptools\dist.py:331: UserWarning: Normalizing '0.1.03' to '0.1.3'
normalized_version,
running install
Installing Python module...
running build
running build_py
creating build
creating build\lib
creating build\lib\vpnotebook
copying vpnotebook\__init__.py -> build\lib\vpnotebook
creating build\lib\vpnotebook\data
copying vpnotebook\data\kernel.json -> build\lib\vpnotebook\data
running install_lib
creating c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook
creating c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\data
copying build\lib\vpnotebook\data\kernel.json -> c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\data
copying build\lib\vpnotebook\__init__.py -> c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook
byte-compiling c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook\__init__.py to __init__.cpython-36.pyc
running install_egg_info
running egg_info
writing vpnotebook.egg-info\PKG-INFO
writing dependency_links to vpnotebook.egg-info\dependency_links.txt
writing top-level names to vpnotebook.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'vpnotebook.egg-info\SOURCES.txt'
writing manifest file 'vpnotebook.egg-info\SOURCES.txt'
Copying vpnotebook.egg-info to c:\users\zachary\appdata\local\programs\python\python36-32\Lib\site-packages\vpnotebook-0.1.3-py3.6.egg-info
running install_scripts
writing list of installed files to 'C:\Users\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt'
Installing custom kernel ...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\setup.py", line 30, in <module>
package_data={'vpnotebook': ['data/kernel.json']},
File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "c:\users\zachary\appdata\local\programs\python\python36-32\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\vpnotebook\__init__.py", line 72, in run
run_kernel_install(False)
File "C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\vpnotebook\__init__.py", line 63, in run_kernel_install
install_kernel_spec(source_dir, kernel_name='vpython', user=user)
NameError: free variable 'install_kernel_spec' referenced before assignment in enclosing scope
----------------------------------------
Command "c:\users\zachary\appdata\local\programs\python\python36-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Zachary\\AppData\\Local\\Temp\\pip-build-dx_wvbg0\\vpnotebook\\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\Zachary\AppData\Local\Temp\pip-3q5u2e2l-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Zachary\AppData\Local\Temp\pip-build-dx_wvbg0\vpnotebook\
The immediate fix is to install jupyter before you install vpnotebook:
pip install jupyter
Thanks for reporting this; in the future issues posted at either the location #user1114907 indicated or at the main github repo: https://github.com/BruceSherwood/vpython-jupyter/issues
This appears to be a bug in vpnotebook, upon which vpython depends. Trying to install vpnotebook in both Python 2.7 and 3.5 fails with the same error, which appears to have been caused by the package's authors not even using a basic linter. I would suggest reporting this to said authors, but there are no contact details, repositories, or project websites listed on the package's PyPI page.
If your python version is greater than 2.7.9, skip to step 3
Install python version > 2.7.9 [2.7.14 is the latest]
Download latest version of python
extract the archive
./configure
make
make install
Download and re-install pip
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
Install jupyter First
sudo pip install jupyter
Then, install vpython
sudo pip install vpython
Post-installation Screenshot
Trying to install pip and I get this error
following https://github.com/Homebrew/homebrew/wiki/Homebrew-and-Python
Sumners-MacBook-Pro:Downloads Sumner$ python get-pip.py
Downloading/unpacking pip
Downloading pip-1.5.4-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Cleaning up...
Exception:
Traceback (most recent call last):
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/commands/install.py", line 279, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 1380, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 664, in install
self.move_wheel_files(self.source_dir, root=root)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/req.py", line 894, in move_wheel_files
pycompile=self.pycompile,
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/wheel.py", line 202, in move_wheel_files
clobber(source, lib_dir, True)
File "/var/folders/l6/0vw_83pn3kq52x2wjhkmns2r0000gn/T/tmpAovvNy/pip.zip/pip/wheel.py", line 189, in clobber
os.makedirs(destsubdir)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Storing debug log for failure in /Users/Sumner/Library/Logs/pip.log
As I cannot comment due to my lack of 50 reputation, I will 'comment' in an answer.
Although you may be admin, you still have to type sudo before you do anything...
To check if your account has admin privileges, type sudo bash in your terminal, and if it says myusername is not in the sudoers file. This incident will be reported., then you aren't an admin.
Here is a short demonstration of the above:
ajs-iMac-5:~ aj8uppal$ sudo bash
Password:
bash-3.2#
bash-3.2# exit
ajs-iMac-5:~ aj8uppal$ pip install colorama
Downloading/unpacking colorama
Downloading colorama-0.2.7.tar.gz
Running setup.py (path:/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py) egg_info for package colorama
Installing collected packages: colorama
Running setup.py install for colorama
error: could not create '/Library/Python/2.7/site-packages/colorama': Permission denied
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip-geh1_f-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/colorama
copying colorama/__init__.py -> build/lib/colorama
copying colorama/ansi.py -> build/lib/colorama
copying colorama/ansitowin32.py -> build/lib/colorama
copying colorama/initialise.py -> build/lib/colorama
copying colorama/win32.py -> build/lib/colorama
copying colorama/winterm.py -> build/lib/colorama
running install_lib
creating /Library/Python/2.7/site-packages/colorama
THE ERROR: error: could not create '/Library/Python/2.7/site-packages/colorama': Permission denied
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip-geh1_f-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/pip_build_aj8uppal/colorama
Storing debug log for failure in /var/folders/f7/r3hxg4tx3859tjpb0n_q9hnw0000gp/T/tmptJWePV
ajs-iMac-5:~ aj8uppal$ sudo pip install colorama
Downloading/unpacking colorama
Downloading colorama-0.2.7.tar.gz
Running setup.py (path:/private/tmp/pip_build_root/colorama/setup.py) egg_info for package colorama
Installing collected packages: colorama
Running setup.py install for colorama
Successfully installed colorama
Cleaning up...
ajs-iMac-5:~ aj8uppal$
Or you could combine the first two steps and head into the third one, and if it raises an error when you type in sudo, then you aren't an admin.
Here you go! You need admin privilege to do it. Type sudo python get-pip.py and enter the admin password.
It will automatically install pip-6.1.1 for you.
This appears to be because the default version of Python, shipped with the OSX operating system, requires sudo permissions to run in a few places.
In general you probably shouldn't be developing with the operating system version of python, and I personally prefer never to sudo install anything that doesn't obviously need root access.
Instead of using the default version, install a user-specific Python installation with Homebrew.
brew install python
And then you get the pip command properly installed for free!