Error when install picamera on python 3.5.2 windows 10 - python

I tried to install the picamera to my python 3.5 on windows 10 with pip 9.
Also,i looked online and know that i need to install pyyaml and i did. Its really strange, some suggestion is that the pip need to be the same location as setup.py? which is even more confusing. Anyway, below is what i did, hope it help.
Excuted command:
pip install --user picamera
Command Output:
Collecting picamera
Using cached picamera-1.13.tar.gz
Building wheels for collected packages: picamera
Running setup.py bdist_wheel for picamera: started
Running setup.py bdist_wheel for picamera: finished with status 'error'
Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\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\Dell\AppData\Local\Temp\tmpfj3othpnpip-wheel- --python-tag cp35:
running bdist_wheel
running build
running build_py
creating build
creating build\lib
creating build\lib\picamera
copying picamera\array.py -> build\lib\picamera
copying picamera\bcm_host.py -> build\lib\picamera
copying picamera\camera.py -> build\lib\picamera
copying picamera\color.py -> build\lib\picamera
copying picamera\display.py -> build\lib\picamera
copying picamera\encoders.py -> build\lib\picamera
copying picamera\exc.py -> build\lib\picamera
copying picamera\frames.py -> build\lib\picamera
copying picamera\mmal.py -> build\lib\picamera
copying picamera\mmalobj.py -> build\lib\picamera
copying picamera\renderers.py -> build\lib\picamera
copying picamera\streams.py -> build\lib\picamera
copying picamera\__init__.py -> build\lib\picamera
running egg_info
writing picamera.egg-info\PKG-INFO
writing requirements to picamera.egg-info\requires.txt
writing dependency_links to picamera.egg-info\dependency_links.txt
writing top-level names to picamera.egg-info\top_level.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'picamera.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'debian'
no previously-included directories found matching 'docs'
writing manifest file 'picamera.egg-info\SOURCES.txt'
warning: build_py: byte-compiling is disabled, skipping.
installing to build\bdist.win-amd64\wheel
running install
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
with io.open('/proc/cpuinfo', 'r') as cpuinfo:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
main()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
cmdclass = {'install': CustomInstallCommand},
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Roaming\Python\Python35\site-packages\wheel\bdist_wheel.py", line 240, in run
self.run_command('install')
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
raise ValueError('Unable to open /proc/cpuinfo')
ValueError: Unable to open /proc/cpuinfo
----------------------------------------
Running setup.py clean for picamera
Failed to build picamera
Installing collected packages: picamera
Running setup.py install for picamera: started
Running setup.py install for picamera: finished with status 'error'
Complete output from command C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\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\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
Traceback (most recent call last):
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 101, in run
with io.open('/proc/cpuinfo', 'r') as cpuinfo:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 145, in <module>
main()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 140, in main
cmdclass = {'install': CustomInstallCommand},
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\Dell\AppData\Local\Programs\Python\Python35\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\setup.py", line 113, in run
raise ValueError('Unable to open /proc/cpuinfo')
ValueError: Unable to open /proc/cpuinfo
----------------------------------------
Failed building wheel for picamera
Command "C:\Users\Dell\AppData\Local\Programs\Python\Python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Dell\\AppData\\Local\\Temp\\pycharm-packaging\\picamera\\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\Dell\AppData\Local\Temp\pip-x3ancwkq-record\install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in C:\Users\Dell\AppData\Local\Temp\pycharm-packaging\picamera\
Error occured:
FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
Tried to install it with pycharm and still no luck

FileNotFoundError: [Errno 2] No such file or directory: '/proc/cpuinfo'
Cause the file only exists in the linux or unix-like System , not in the Windows system or the mac System.That's why you can't intall successfully.

I encountered the same problem when i was working with Kivy and python
Got an error saying "No module named picamera found"
Solution which helped me get through that :
pip install opencv-python
Yes.! it helped me, might work for you.
Edit : I tried this on Python 3.7 (OS : Windows 10)

Although it's old, might be useful to anyone who runs into the same problem.
Steps.
Open terminal (if you have a virtual env, activate it)
type "set READTHEDOCS=True"
pip install picamera
OR
4.pip install picamera[array]

Related

How to solve CMake must be installed to build the following extensions: dlib in PyCharm?

Facing the following error while installing dlib for the OpenCV project. It shows that
CMake must be installed to build the following extensions: dlib.
Command Output:
Collecting dlib==19.18.0
Using cached dlib-19.18.0.tar.gz (3.1 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'
ERROR: Command errored out with exit status 1:
command: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib'
cwd: C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\
Complete output (57 lines):
running install
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
Traceback (most recent call last):
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 120, in get_cmake_version
out = subprocess.check_output(['cmake', '--version'])
File "D:\Install Drive\lib\subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "D:\Install Drive\lib\subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "D:\Install Drive\lib\subprocess.py", line 951, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "D:\Install Drive\lib\subprocess.py", line 1420, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 223, in <module>
setup(
File "D:\Install Drive\lib\site-packages\setuptools\__init__.py", line 165, in setup
return distutils.core.setup(**attrs)
File "D:\Install Drive\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "D:\Install Drive\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "D:\Install Drive\lib\distutils\command\install.py", line 546, in run
self.run_command('build')
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "D:\Install Drive\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "D:\Install Drive\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "D:\Install Drive\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 129, in run
cmake_version = self.get_cmake_version()
File "C:\Users\mahmu\AppData\Local\Temp\pip-install-a4s1a_zh\dlib\setup.py", line 122, in get_cmake_version
raise RuntimeError("\n*******************************************************************\n" +
RuntimeError:
*******************************************************************
CMake must be installed to build the following extensions: dlib
*******************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'D:\Install Drive\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\mahmu\\AppData\\Local\\Temp\\pip-install-a4s1a_zh\\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\mahmu\AppData\Local\Temp\pip-record-mjm6k3c3\install-record.txt' --single-version-externally-managed --compile --install-headers 'D:\Install Drive\Include\dlib' Check the logs for full command output.
WARNING: You are using pip version 20.2.3; however, version 21.1.2 is available.
You should consider upgrading via the 'D:\Install Drive\python.exe -m pip install --upgrade pip' command.
Notice that in the output that "CMake must be installed to build the following extensions: dlib". So install CMake first and only then try to install dlib. If CMake is installed, try updating your pip version to 21.1.2 via "D:\Install Drive\python.exe -m pip install --upgrade pip".
It requires cmake must be installed before installing dlib. Do execute in the following order.
pip install cmake
pip install dlib
This will fix the issue.

Error in updating AWS cli to latest version

I'm trying to update AWS CLI to the latest version. I'm following the below AWS documentation:
Aws cli upgrade with sudo access
When I run the command:
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
I get a long python error, which I can't understand. What is the problem here?
Error message:
Deprecated Python version detected: Python 2.7
Starting July 15, 2021, the AWS CLI will no longer support this version of Python. To continue receiving service updates, bug fixes, and security updates please upgrade to Python 3.6 or later. More information can be found here: https://aws.amazon.com/blogs/developer/announcing-end-of-support-for-python-2-7-in-aws-sdk-for-python-and-aws-cli-v1/
Running cmd: /bin/python virtualenv.py --no-download --python /bin/python /usr/local/aws
Running cmd: /usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz
Traceback (most recent call last):
File "./awscli-bundle/install", line 270, in <module>
main()
File "./awscli-bundle/install", line 247, in main
pip_install_packages(opts.install_dir)
File "./awscli-bundle/install", line 167, in pip_install_packages
_install_setup_deps(pip_script, '.')
File "./awscli-bundle/install", line 184, in _install_setup_deps
pip_script, setup_package_dir, setuptools_scm_tarball))
File "./awscli-bundle/install", line 90, in run
p.returncode, cmd, output))
__main__.BadRCError: Bad rc (1) for cmd '/usr/local/aws/bin/pip install --no-binary :all: --no-cache-dir --no-index --find-links file://. setuptools_scm-3.3.3.tar.gz': Looking in links: file://.
Processing ./setuptools_scm-3.3.3.tar.gz
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Command errored out with exit status 1:
command: /usr/local/aws/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-M9znG_/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-M9znG_/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 /tmp/pip-req-build-M9znG_/pip-egg-info
cwd: /tmp/pip-req-build-M9znG_/
Complete output (36 lines):
running egg_info
creating /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info
writing /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/PKG-INFO
writing top-level names to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/top_level.txt
writing dependency_links to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/dependency_links.txt
writing entry points to /tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/entry_points.txt
writing manifest file '/tmp/pip-req-build-M9znG_/pip-egg-info/setuptools_scm.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-req-build-M9znG_/setup.py", line 118, in <module>
setuptools.setup(**arguments)
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
self.find_sources()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
mm.run()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
self.add_defaults()
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 574, in add_defaults
rcfiles = list(walk_revctrl())
File "/usr/local/aws/lib/python2.7/site-packages/setuptools/command/sdist.py", line 20, in walk_revctrl
for item in ep.load()(dirname):
File "/tmp/pip-req-build-M9znG_/src/setuptools_scm/integration.py", line 22, in find_files
command = ep.load()
File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/usr/local/aws/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2453, in resolve
raise ImportError(str(exc))
ImportError: 'module' object has no attribute 'FILES_COMMAND'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Python 2.7 and pip install realted issues with _markerlib and installing other packages failures

Currently trying to install some web framework but it fails with following error. It also shows the same error when I try to install other packages as well. I can't figure out where it stems from. Any ideas would help a lot.
PS D:\Python_Programming_Zed_Show\Exersize_46\Python27_Projects\Exersize_48\Exersize_48> python -m pip install lpthw.web
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/late
st/development/release-process/#python-2-support
Collecting lpthw.web
Using cached https://files.pythonhosted.org/packages/52/0d/a200087bb551895143fedfb5f7df416ccb7ecb46428e04dd011a7ea19689/lpthw.web-1.1.tar.gz
ERROR: Command errored out with exit status 1:
command: 'D:\Python27\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'d:\\users\\arhitect\\appdata\\local\\temp\\pip-install-gj9eke\\lpthw.web\\setup.py'"'"'; __file__='"'"'d:\\users\\arhitect\\appdata\\local\\temp\\pip-install-gj9eke\\lpthw.web\\setup.py'"'"';f=getattr(tok
enize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: d:\users\arhitect\appdata\local\temp\pip-install-gj9eke\lpthw.web\
Complete output (28 lines):
running egg_info
creating pip-egg-info\lpthw.web.egg-info
writing pip-egg-info\lpthw.web.egg-info\PKG-INFO
writing top-level names to pip-egg-info\lpthw.web.egg-info\top_level.txt
writing dependency_links to pip-egg-info\lpthw.web.egg-info\dependency_links.txt
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "d:\users\arhitect\appdata\local\temp\pip-install-gj9eke\lpthw.web\setup.py", line 17, in <module>
platforms=["any"],
File "D:\Python27\lib\distutils\core.py", line 151, in setup
dist.run_commands()
File "D:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "D:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\setuptools\command\egg_info.py", line 177, in run
writer = ep.load(installer=installer)
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2241, in load
if require: self.require(env, installer)
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "d:\users\arhitect\downloads\distribute-0.7.3\distribute-0.7.3\pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named _markerlib
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
PS D:\Python_Programming_Zed_Show\Exersize_46\Python27_Projects\Exersize_48\Exersize_48>
The problematic import comes from distribute-0.7.3 which is outdated package and should not be used. Remove the directory d:\users\arhitect\downloads\distribute-0.7.3.

Problem in installing dlib in PyCharm (macOS)

I am a beginner in the Python programming language. I am Working on a project for facial landmark detection in Python. For this I am trying to use dlib.
I am using PyCharm IDE for Python programming language, but when I am trying to install dlib library on my PyCharm package then I am getting the following error.
Can anyone please help me solving this.
Edit:
Here is the complete error that I am getting.
**Collecting dlib
Using cached https://files.pythonhosted.org/packages/05/57/e8a8caa3c89a27f80bc78da39c423e2553f482a3705adc619176a3a24b36/dlib-19.17.0.tar.gz
Installing collected packages: dlib
Running setup.py install for dlib: started
Running setup.py install for dlib: finished with status 'error'
Complete output from command /Users/mayanktiwari/human_detect/untitled/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib:
running install
running build
running build_py
package init file '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.7.2 (default, Dec 27 2018, 07:35:52)
Invoking CMake setup: 'cmake /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python -DCMAKE_BUILD_TYPE=Release'
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- broken
CMake Error at /usr/local/Cellar/cmake/3.13.2/share/cmake/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"/usr/bin/cc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_dc7d9/fast"
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
CMake will not be able to correctly generate this project.
-- Configuring incomplete, errors occurred!
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeOutput.log".
See also "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/temp.macosx-10.13-x86_64-3.7/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 261, in <module>
'Topic :: Software Development',
File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/__init__.py", line 145, in setup
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Users/mayanktiwari/human_detect/untitled/lib/python3.7/site-packages/setuptools-40.8.0-py3.7.egg/setuptools/command/install.py", line 61, in run
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 135, in run
self.build_extension(ext)
File "/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/setup.py", line 172, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/tools/python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/build/lib.macosx-10.13-x86_64-3.7', '-DPYTHON_EXECUTABLE=/Users/mayanktiwari/human_detect/untitled/bin/python', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
----------------------------------------
Command "/Users/mayanktiwari/human_detect/untitled/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/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 /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pip-record-hq673j64/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mayanktiwari/human_detect/untitled/include/site/python3.7/dlib" failed with error code 1 in /private/var/folders/ww/21lp_4013plfs5g1ym7wh39h0000gn/T/pycharm-packaging/dlib/**
conda install cmake
Then
pip install dlib
It works for me.
I have found the answer to this question. We just need to follow simple steps to install dlib in Python.
Install Python
Install Pycharm
Install Anaconda
Open anaconda, create a new enviornment, and then execute the following commands in the same order.
conda update conda
conda update anaconda
conda install cmake
conda install -c conda-forge dlib
Now in this way you can install dlib on anaconda's virtual enviornment. Next you can access this virtual enviornment inside your Pycharm editor.

Import error when deploying django app to Heroku

I am trying to deploy the app that they have mentioned in the getting started section. However I am getting error ModuleNotFoundError: No module named 'six'. The whole build log is mentioned below:
-----> Python app detected
-----> Installing python-3.6.1
-----> Installing pip
-----> Installing requirements with pip
Collecting dj-database-url==0.4.1 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 1))
Downloading dj-database-url-0.4.1.tar.gz
Collecting Django==1.9.7 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 2))
Downloading Django-1.9.7-py2.py3-none-any.whl (6.6MB)
Collecting gunicorn==19.6.0 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 3))
Downloading gunicorn-19.6.0-py2.py3-none-any.whl (114kB)
Collecting psycopg2==2.6.2 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 4))
Downloading psycopg2-2.6.2.tar.gz (376kB)
Collecting whitenoise==2.0.6 (from -r /tmp/build_1900e0c2c9d2dd1135d0cd7b517175ae/requirements.txt (line 5))
Downloading whitenoise-2.0.6-py2.py3-none-any.whl
Installing collected packages: dj-database-url, Django, gunicorn, psycopg2, whitenoise
Running setup.py install for dj-database-url: started
Running setup.py install for dj-database-url: finished with status 'error'
Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-e09119wj-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying dj_database_url.py -> build/lib
running egg_info
writing dj_database_url.egg-info/PKG-INFO
writing dependency_links to dj_database_url.egg-info/dependency_links.txt
writing top-level names to dj_database_url.egg-info/top_level.txt
reading manifest file 'dj_database_url.egg-info/SOURCES.txt'
writing manifest file 'dj_database_url.egg-info/SOURCES.txt'
running install_lib
copying build/lib/dj_database_url.py -> /app/.heroku/python/lib/python3.6/site-packages
byte-compiling /app/.heroku/python/lib/python3.6/site-packages/dj_database_url.py to dj_database_url.cpython-36.pyc
running install_egg_info
Copying dj_database_url.egg-info to /app/.heroku/python/lib/python3.6/site-packages/dj_database_url-0.4.1-py3.6.egg-info
running install_scripts
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-vkji1x5w/dj-database-url/setup.py", line 89, in <module>
'Programming Language :: Python :: 3.5',
File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/app/.heroku/python/lib/python3.6/distutils/command/install.py", line 557, in run
self.run_command(cmd_name)
File "/app/.heroku/python/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install_scripts.py", line 17, in run
import setuptools.command.easy_install as ei
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 49, in <module>
from setuptools.py27compat import rmtree_safe
File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/py27compat.py", line 7, in <module>
import six
ModuleNotFoundError: No module named 'six'
----------------------------------------
Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vkji1x5w/dj-database-url/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-e09119wj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vkji1x5w/dj-database-url/
! Push rejected, failed to compile Python app.
! Push failed
I have even installed the six module but it's not working.
You (alongwith with a lot of others) are facing this issue
upgrade your CI environment to just short of v36 with the following pre-install command:
pip install --upgrade "setuptools < 36"
Then, by ensure that your soon-to-be-created virtualenv inherited that version with the following environment variable:
VIRTUALENV_NO_DOWNLOAD=1
Another fix is by installing the module six before running any other command.
The official response in the Github repo has been that it will be fixed asap.
Hope it works. Cheers!

Categories