I have VM with Win7. Python is running in Version 2.7. Now I want to install Django. I download django as tar.gz from official website. Then I move the file to VM and try to install with...
C:\Users\TestUser>pip install D:\Django-1.10.5.tar.gz
But it not work. I get this output:
Processing d:\django-1.10.5.tar.gz
Building wheels for collected packages: Django
Running setup.py bdist_wheel for Django
Stored in directory: C:\Users\TestUser\AppData\Local\pip\Cache\wheels\78\62\f
a\c970671f67ec027f6445dc8ed9a3155e774c0e75ca63dd291b
Successfully built Django
Installing collected packages: Django
Exception:
Traceback (most recent call last):
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\basecommand.py", lin
e 223, in main
status = self.run(options, args)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\commands\install.py"
, line 298, in run
root=options.root_path,
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_set.py", lin
e 622, in install
**kwargs
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_install.py",
line 808, in install
self.move_wheel_files(self.source_dir, root=root)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\req\req_install.py",
line 1003, in move_wheel_files
isolated=self.isolated,
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\wheel.py", line 339,
in move_wheel_files
clobber(source, lib_dir, True)
File "D:\TestUser\Programm\Python27\lib\site-packages\pip\wheel.py", line 323,
in clobber
os.utime(destfile, (st.st_atime, st.st_mtime))
WindowsError: [Error 87] Falscher Parameter: 'D:\\TestUser\\Programm\\Python27\\
Lib\\site-packages\\django\\shortcuts.py'
Also the following comand not work:
D:\dist\Django-1.10.5>python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to Django.egg-info\requires.txt
writing Django.egg-info\PKG-INFO
writing top-level names to Django.egg-info\top_level.txt
writing dependency_links to Django.egg-info\dependency_links.txt
writing entry points to Django.egg-info\entry_points.txt
reading manifest file 'Django.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'django\contrib\admin\bin'
warning: no previously-included files matching '__pycache__' found anywhere in
istribution
writing manifest file 'Django.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\django
copying django\shortcuts.py -> build\lib\django
error: [Error 87] Falscher Parameter: 'build\\lib\\django\\shortcuts.py'
What's wrong? Thanks.
Eric
Related
I try to install a python package. It's fitsio. I work on Jupyter Notebook but I am a beginner.
I try pip install fitsio but I have an error like you see :
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools>pip install fitsio
Collecting fitsio
Using cached fitsio-1.1.7.tar.gz (5.0 MB)
Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in c:\users\utilisateur\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from fitsio) (1.21.6)
Using legacy 'setup.py install' for fitsio, since package 'wheel' is not installed.
Installing collected packages: fitsio
Running setup.py install for fitsio ... error
error: subprocess-exited-with-error
× Running setup.py install for fitsio did not run successfully.
│ exit code: 1
╰─> [64 lines of output]
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\fitsio
copying fitsio\fitslib.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\header.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\test.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\util.py -> build\lib.win-amd64-3.7\fitsio
copying fitsio\__init__.py -> build\lib.win-amd64-3.7\fitsio
creating build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\base.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\image.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\table.py -> build\lib.win-amd64-3.7\fitsio\hdu
copying fitsio\hdu\__init__.py -> build\lib.win-amd64-3.7\fitsio\hdu
running egg_info
writing fitsio.egg-info\PKG-INFO
writing dependency_links to fitsio.egg-info\dependency_links.txt
writing requirements to fitsio.egg-info\requires.txt
writing top-level names to fitsio.egg-info\top_level.txt
reading manifest file 'fitsio.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'fitsio.egg-info\SOURCES.txt'
copying fitsio\fitsio_pywrap.c -> build\lib.win-amd64-3.7\fitsio
creating build\lib.win-amd64-3.7\fitsio\test_images
copying fitsio\test_images\test_gzip_compressed_image.fits.fz -> build\lib.win-amd64-3.7\fitsio\test_images
running build_ext
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 284, in <module>
cmdclass={"build_ext": build_ext_subclass}
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\install.py", line 61, in run
return orig.install.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\install.py", line 545, in run
self.run_command('build')
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 72, in run
build_ext.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\site-packages\setuptools\command\build_ext.py", line 87, in run
_build_ext.run(self)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64__qbz5n2kfra8p0\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Users\UTILIS~1\AppData\Local\Temp\pip-install-pugpqzau\fitsio_302dc86b80ce48538f11d014b602f5f7\setup.py", line 80, in build_extensions
CCold = self.compiler.compiler
AttributeError: 'MSVCCompiler' object has no attribute 'compiler'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> fitsio
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
To resolve my problem I try to update python -m pip install –upgrade pip & pip install –upgrade wheel & pip install –upgrade setuptools.
Moreover I download Microsoft c++ build tools.
I install successfully cfitsio with Anaconda but when I write import cfitsio Jupyter notebook does not recognize the package.
Thanks for reading.
Check which kernel you have picked to ensure that your import statement corresponds to the respective Python environment and package installed via pip.
See VSCode issue with Python versions and environments from Jupyter Notebooks and https://github.com/microsoft/vscode-jupyter/issues/7373 for additional information.
As part of a script I am writing, I need to install the package autodock vina for the purpose of ligand and protein binding. Every time I attempt to "pip install vina", I recieve an error message " ValueError: Boost library location was not found!". Upon attempting to install boost manually, I have been unable to run the bootstrap file, as it does not make the b2 folder that online tutorials say it will make.
To resolve this issue, I installed conda, and made an active environment with every single prerequisite, including boost, installed. I have checked for the version of all of these prerequisites and confirmed their existence, as well as double and triple-checking that I am in the write active environment. Upon installation, I either get the same issue (using conda install vina) or when using "conda install -c bioconda autodock-vina", I get a message saying that the package does not exist (despite adding cforge and bioconda as active package handlers, and the existence of said package is clearly documented online). Does anyone have any suggestions? I've been attempting to install this piece of software for 3 days and I've completely exhausted the documentation, as well as all other similar question answers, with nothing working.
Full error message:
Collecting vina
Using cached vina-1.2.3.tar.gz (95 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> [56 lines of output]
Version found 1.2.3 (from __init__.py)
running egg_info
creating vina.egg-info
writing vina.egg-info\PKG-INFO
writing dependency_links to vina.egg-info\dependency_links.txt
writing requirements to vina.egg-info\requires.txt
writing top-level names to vina.egg-info\top_level.txt
writing manifest file 'vina.egg-info\SOURCES.txt'
Boost library is not installed in this conda environment.
Traceback (most recent call last):
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
main()
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\chris\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 177, in get_requires_for_build_wheel
return self._get_build_requires(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 159, in _get_build_requires
self.run_setup()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\build_meta.py", line 174, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 346, in <module>
setup(
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\dist.py", line 1214, in run_command
super().run_command(command)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 308, in run
self.find_sources()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 315, in find_sources
mm.run()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 550, in run
self.add_defaults()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\command\egg_info.py", line 587, in add_defaults
sdist.add_defaults(self)
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 228, in add_defaults
self._add_defaults_ext()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\command\sdist.py", line 311, in _add_defaults_ext
build_ext = self.get_finalized_command('build_ext')
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 299, in get_finalized_command
cmd_obj.ensure_finalized()
File "C:\Users\chris\AppData\Local\Temp\pip-build-env-r7vbpka4\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 247, in finalize_options
raise ValueError(error_msg)
ValueError: Boost library location was not found!
Directories searched: conda env, /usr/local/include and /usr/include.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
I also get this error. I asked ResearchGate how to solve this problem and Cheng Shen adviced to use WSL/WSL2 to simulate a Linux environment and then run conda install -c bioconda vina (or another command like this)
What I did.
Install WSL and Ubuntu on Windows 2. Run code . in WSL terminal (for installing VS Code [recommended])
Install Anaconda/Miniconda following this guide
Type conda install -c bioconda vina in Ubuntu terminal (bioconda channel will download all required packages - boost, swig, etc.)
Vina should be successfully installed ( vina --version in WSL Terminal to check)
I found it much easier to install packages for docking via WSL and use VS Code to run scripts there. It's VERY easier than trying to solve this problem by configuring boost for Windows. If you have any questions you can ask me in ResearchGate.
I have CMake tool installed using Visual STudio Build tools 2019. I have rechecked my ENV variables multiple times.
I have tried installation using the Source. I have followed this and all the other discussions as well.
Here is the detailed error
running install
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\easy_install.py:160: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running bdist_egg
running egg_info
writing tools/python\dlib.egg-info\PKG-INFO
writing dependency_links to tools/python\dlib.egg-info\dependency_links.txt
writing top-level names to tools/python\dlib.egg-info\top_level.txt
package init file 'tools\python\dlib\__init__.py' not found (or not a regular file)
reading manifest file 'tools/python\dlib.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
no previously-included directories found matching 'tools\python\build*'
no previously-included directories found matching 'dlib\cmake_utils\*\build*'
no previously-included directories found matching 'dlib\test'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
writing manifest file 'tools/python\dlib.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
running build_ext
C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(cmake_version) < '3.1.0':
Building extension for Python 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]
Invoking CMake setup: 'cmake C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib
.win-amd64-3.10 -DPYTHON_EXECUTABLE=C:\Users\asus\PycharmProjects\drowsiness-detection\envt\Scripts\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\lib.win-amd64-3.10 -A x64'
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.22000.
CMake Error at CMakeLists.txt:14 (project):
Failed to run MSBuild command:
C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/MSBuild/Current/Bin/MSBuild.exe
to get the value of VCTargetsPath:
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 27-Feb-22 6:58:45 PM.
Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763.0
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\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
Done Building Project "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj" (default target) (1) ->
(_CheckWindowsSDKInstalled target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.Cpp.WindowsSDK.targets(46,5): error MSB8036: The Windows SDK version 10.0.17763
.0 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\asus\Downloads\dlib-19.23.0\dlib-19.23.0\build\temp.win-amd64-3.10\Release\CMakeFiles\3.18.4\VCTargetsPath.vcxproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.21
Exit code: 1
-- Configuring incomplete, errors occurred!
See also "C:/Users/asus/Downloads/dlib-19.23.0/dlib-19.23.0/build/temp.win-amd64-3.10/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 222, in <module>
setup(
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\__init__.py", line 155, in setup
return distutils.core.setup(**attrs)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 148, in setup
return run_commands(dist)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\core.py", line 163, in run_commands
dist.run_commands()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 967, in run_commands
self.run_command(cmd)
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\dist.py", line 986, in run_command
cmd_obj.run()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 74, in run
self.do_egg_install()
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\command\install.py", line 116, in do_egg_install
self.run_command('bdist_egg')
File "C:\Users\asus\PycharmProjects\drowsiness-detection\envt\lib\site-packages\setuptools\_distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
self.build_extension(ext)
File "C:\Users\asus\Downloads\dlib-19.23.0\dlib-19.23.0\setup.py", line 171, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\asus\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-DPYTHON_EXECUTABLE=C:\\Users\\asus\\PycharmProjects\\drowsiness-detection\\envt\\Scripts\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\asus\\Downloads\\dlib-19.23.0\\dlib-19.23.0\\build\\lib.win-amd64-3.10', '-A', 'x64']' returned non-zero exit status 1.
I am not using Anacodna and I am on Windows 10 platform. Any help is much appreciated.
Do you have Windows SDK version 10.0.17763.0 installed? It should look something like this screenshot:
I'm getting the below mentioned bad marshal data error when installing my own created python package on Mac OS.
deveshs-MacBook-Pro:mycli devesh$ sudo python setup-4.0.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing requirements to mycli.egg-info/requires.txt
writing cftcli.egg-info/PKG-INFO
writing top-level names to mycli.egg-info/top_level.txt
writing dependency_links to mycli.egg-info/dependency_links.txt
writing entry points to mycli.egg-info/entry_points.txt
reading manifest file 'mycli.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'mycli.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-intel/egg
running install_lib
running build_py
copying mycli.egg-info/PKG-INFO -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/SOURCES.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/dependency_links.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/entry_points.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/requires.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
copying mycli.egg-info/top_level.txt -> build/bdist.macosx-10.10-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
Traceback (most recent call last):
File "setup-4.0.py", line 42, in <module>
"requests==2.4.3",
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Python/2.7/site-packages/setuptools/command/install.py", line 67, in run
self.do_egg_install()
File "/Library/Python/2.7/site-packages/setuptools/command/install.py", line 109, in do_egg_install
self.run_command('bdist_egg')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 208, in run
os.path.join(archive_root, 'EGG-INFO'), self.zip_safe()
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 244, in zip_safe
return analyze_egg(self.bdist_dir, self.stubs)
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 354, in analyze_egg
safe = scan_module(egg_dir, base, name, stubs) and safe
File "/Library/Python/2.7/site-packages/setuptools/command/bdist_egg.py", line 391, in scan_module
code = marshal.load(f)
ValueError: bad marshal data (unknown type code)
I tried deleting all the *.pyc files from the setuptools directory.
Please guide how this issue can be resolved.
Thanks.
First I thought that the issue is with the filename, which should be setup.py only, but it gave same error with sudo python setup.py install too.
A workaround I found out is to create a source-distribution first.
see documentation here
Below is the script which will work fine and put us out from the above issue.
cp -f setup-4.0.py setup.py
python setup.py sdist --format=zip,gztar
sudo pip install dist/mycli-4.0.tar.gz
rm setup.py
To uninstall: sudo pip uninstall mycli
Hope it will help some Mac users. Thanks.
I'm trying to deploy my app to Heroku. It is using pyOpenSSL, which requires cryptography, which requires libffi. I found a custom buildpack that includes libffi here: https://github.com/mfenniak/heroku-buildpack-python-libffi. However, cryptography cannot seem to find libffi even though it's on LD_LIBRARY_PATH:
$ heroku run bash
heroku> echo $LD_LIBRARY_PATH
/app/.heroku/vendor/lib:/app/vendor/libffi-3.0/lib
heroku> ls /app/vendor/libffi-3.0/lib
libffi-3.0.13 libffi.a libffi.la libffi.so libffi.so.6 libffi.so.6.0.1 pkgconfig
However, I'm not sure LD_LIBRARY_PATH is available during install process, but it is part of the compile step of the buildpack: https://github.com/mfenniak/heroku-buildpack-python-libffi/commit/6ce48d4fd6c55fc3dc462cf6300c17854732b6e2
In general, this buildpack works and I used it previously with bcrypt (https://pypi.python.org/pypi/bcrypt).
Here is the heroku deployment process which fails:
$ git push staging master
Fetching repository, done.
Counting objects: 20, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1.71 KiB | 0 bytes/s, done.
Total 11 (delta 9), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.4.
-----> Using Python runtime (python-2.7.4)
-----> Noticed cffi. Bootstrapping libffi.
PKG_CONFIG_PATH=:/app/vendor/libffi-3.0/lib/pkgconfig/
libffi.pc is in-place at /app/vendor/libffi-3.0/vendor/lib/pkgconfig/libffi.pc, libffi-based builds should work!
-----> Installing dependencies using Pip (1.3.1)
Obtaining file:///app (from -r requirements.txt (line 1))
Running setup.py egg_info for package from file:///app
Downloading/unpacking pyOpenSSL==0.14 (from -r requirements.txt (line 76))
Running setup.py egg_info for package pyOpenSSL
no previously-included directories found matching 'doc/_build'
Downloading/unpacking cryptography==0.2.2 (from -r requirements.txt (line 77))
Running setup.py egg_info for package cryptography
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-u45370/cryptography/setup.py", line 113, in <module>
"build": cffi_build,
File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/sdist.py", line 199, in add_defaults
build_py = self.get_finalized_command('build_py')
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/build_py.py", line 73, in finalize_options
_build_py.finalize_options(self)
File "/app/.heroku/python/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options
('force', 'force'))
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-u45370/cryptography/setup.py", line 52, in finalize_options
from cryptography.hazmat.primitives import constant_time, padding
File "cryptography/hazmat/primitives/constant_time.py", line 21, in <module>
_ffi = cffi.FFI()
File "/app/.heroku/python/lib/python2.7/site-packages/cffi/api.py", line 56, in __init__
import _cffi_backend as backend
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/cryptography.egg-info
writing requirements to pip-egg-info/cryptography.egg-info/requires.txt
writing pip-egg-info/cryptography.egg-info/PKG-INFO
writing top-level names to pip-egg-info/cryptography.egg-info/top_level.txt
writing dependency_links to pip-egg-info/cryptography.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/cryptography.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip-build-u45370/cryptography/setup.py", line 113, in <module>
"build": cffi_build,
File "/app/.heroku/python/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/app/.heroku/python/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "<string>", line 14, in replacement_run
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 259, in find_sources
mm.run()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 325, in run
self.add_defaults()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 361, in add_defaults
sdist.add_defaults(self)
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/sdist.py", line 199, in add_defaults
build_py = self.get_finalized_command('build_py')
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/app/.heroku/python/lib/python2.7/site-packages/setuptools/command/build_py.py", line 73, in finalize_options
_build_py.finalize_options(self)
File "/app/.heroku/python/lib/python2.7/distutils/command/build_py.py", line 46, in finalize_options
('force', 'force'))
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 298, in set_undefined_options
src_cmd_obj.ensure_finalized()
File "/app/.heroku/python/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/tmp/pip-build-u45370/cryptography/setup.py", line 52, in finalize_options
from cryptography.hazmat.primitives import constant_time, padding
File "cryptography/hazmat/primitives/constant_time.py", line 21, in <module>
_ffi = cffi.FFI()
File "/app/.heroku/python/lib/python2.7/site-packages/cffi/api.py", line 56, in __init__
import _cffi_backend as backend
ImportError: libffi.so.6: cannot open shared object file: No such file or directory
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-u45370/cryptography
Storing complete log in /app/.pip/pip.log
! Push rejected, failed to compile Python app
To git#heroku.com:my-app-staging.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:my-app-staging.git'
Update
Strangely enough, if I ssh to a dyno heroku run bash and then pip install pyOpenSSL, then it succeeds. But this doesn't seem to help figuring out what's wrong with the deployment process.
It appears github user kennethjiang had the same problem and forked the custom libffi buildpack with a fix just four days ago.
Here are the relevant changes:
https://github.com/kennethjiang/heroku-buildpack-python-libffi/compare/3bb5fab8213f41411f515f21a6c83ff36c8aa1f2...8ef02
$ heroku config:add BUILDPACK_URL=git://github.com/kennethjiang/heroku-buildpack-python-libffi.git
$ git push heroku master
Initializing repository, done.
Counting objects: 3, done.
Writing objects: 100% (3/3), 260 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.4.
-----> Preparing Python runtime (python-2.7.4)
-----> Installing Distribute (0.6.36)
-----> Installing Pip (1.3.1)
-----> Noticed cffi. Bootstrapping libffi.
PKG_CONFIG_PATH=:/app/vendor/libffi-3.0/lib/pkgconfig/
libffi.pc is in-place at /app/vendor/libffi-3.0/vendor/lib/pkgconfig/libffi.pc, libffi-based builds should work!
-----> Installing dependencies using Pip (1.3.1)
Downloading/unpacking pyOpenSSL==0.14 (from -r requirements.txt (line 1))
Running setup.py egg_info for package pyOpenSSL
no previously-included directories found matching 'doc/_build'
Downloading/unpacking cryptography==0.2.2 (from -r requirements.txt (line 2))
Running setup.py egg_info for package cryptography
no previously-included directories found matching 'documentation/_build'
zip_safe flag not set; analyzing archive contents...
six: module references __file__
six: module references __path__
Installed /tmp/pip-build-u24412/cryptography/six-1.6.1-py2.7.egg
Searching for cffi>=0.8
Reading http://pypi.python.org/simple/cffi/
Best match: cffi 0.8.2
Downloading https://pypi.python.org/packages/source/c/cffi/cffi-0.8.2.tar.gz#md5=37fc88c62f40d04e8a18192433f951ec
Processing cffi-0.8.2.tar.gz
Writing /tmp/easy_install-vYzEMy/cffi-0.8.2/setup.cfg
Running cffi-0.8.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vYzEMy/cffi-0.8.2/egg-dist-tmp-KU0RrQ
cc -c c/check__thread.c -o c/check__thread.o
Installed /tmp/pip-build-u24412/cryptography/cffi-0.8.2-py2.7-linux-x86_64.egg
...
Successfully installed pyOpenSSL cryptography six cffi pycparser
Cleaning up...
-----> Discovering process types
Procfile declares types -> (none)
-----> Compressing... done, 27.9MB
-----> Launching... done, v5
http://quiet-atoll-6802.herokuapp.com/ deployed to Heroku
To git#heroku.com:quiet-atoll-6802.git
* [new branch] master -> master