I am trying to install poppler. Its a requirement for one of the projects: https://github.com/idea-fasoc/datasheet-scrubber/tree/master/src/table_extraction
Every time I try in Anaconda Prompt, I get this error.
The conda command doesn't resolve the environment, hence I tried using pip
I installed cmake. I also installed it via VS installer.
This is the error I am still getting. Any help will be greatly appreciated!
(base) C:\Windows\System32>pip install python-poppler
Collecting python-poppler
Using cached python-poppler-0.3.0.tar.gz (823 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-poppler
Building wheel for python-poppler (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [103 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\poppler
copying src\poppler\destination.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -> build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -> build\lib.win-amd64-cpython-39\poppler\cpp
running egg_info
writing src\python_poppler.egg-info\PKG-INFO
writing dependency_links to src\python_poppler.egg-info\dependency_links.txt
writing top-level names to src\python_poppler.egg-info\top_level.txt
reading manifest file 'src\python_poppler.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'src\python_poppler.egg-info\SOURCES.txt'
running build_ext
C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py:32: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
cmake_version = LooseVersion(
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.34.31942.0
-- The CXX compiler identification is MSVC 19.34.31942.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.9.2
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found version "3.9.13")
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python39.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
CMake Error at C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 76, in <module>
setup(
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\wheel\bdist_wheel.py", line 299, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py", line 24, in run
super().run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 39, in run
self.build_extension(ext)
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 68, in build_extension
subprocess.check_call(
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp', '-A', 'x64']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-poppler
Running setup.py clean for python-poppler
Failed to build python-poppler
Installing collected packages: python-poppler
Running setup.py install for python-poppler ... error
error: subprocess-exited-with-error
× Running setup.py install for python-poppler did not run successfully.
│ exit code: 1
╰─> [107 lines of output]
running install
C:\ProgramData\Anaconda3\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(
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\poppler
copying src\poppler\destination.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\document.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\embeddedfile.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\font.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\image.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\page.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagerenderer.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\pagetransition.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\rectangle.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\toc.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\utilities.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\_version.py -> build\lib.win-amd64-cpython-39\poppler
copying src\poppler\__init__.py -> build\lib.win-amd64-cpython-39\poppler
creating build\lib.win-amd64-cpython-39\poppler\cpp
copying src\poppler\cpp\__init__.py -> build\lib.win-amd64-cpython-39\poppler\cpp
running egg_info
writing src\python_poppler.egg-info\PKG-INFO
writing dependency_links to src\python_poppler.egg-info\dependency_links.txt
writing top-level names to src\python_poppler.egg-info\top_level.txt
reading manifest file 'src\python_poppler.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE.txt'
writing manifest file 'src\python_poppler.egg-info\SOURCES.txt'
running build_ext
C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py:32: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
cmake_version = LooseVersion(
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.22621.
-- The C compiler identification is MSVC 19.34.31942.0
-- The CXX compiler identification is MSVC 19.34.31942.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- pybind11 v2.9.2
-- Found PythonInterp: C:/ProgramData/Anaconda3/python.exe (found version "3.9.13")
-- Found PythonLibs: C:/ProgramData/Anaconda3/libs/python39.lib
-- Performing Test HAS_MSVC_GL_LTCG
-- Performing Test HAS_MSVC_GL_LTCG - Success
CMake Error at C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
Call Stack (most recent call first):
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
C:/ProgramData/Anaconda3/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
CMakeLists.txt:13 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/halda/AppData/Local/Temp/pip-install-onyki_zr/python-poppler_a0472eeab1dd487f8486d308273da89b/build/temp.win-amd64-cpython-39/Release/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 76, in <module>
setup(
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\__init__.py", line 87, in setup
return distutils.core.setup(**attrs)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
return run_commands(dist)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
dist.run_commands()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_commands
self.run_command(cmd)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\install.py", line 68, in run
return orig.install.run(self)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\install.py", line 692, in run
self.run_command('build')
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\command\build.py", line 24, in run
super().run()
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\command\build.py", line 132, in run
self.run_command(cmd_name)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command
self.distribution.run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\dist.py", line 1217, in run_command
super().run_command(command)
File "C:\ProgramData\Anaconda3\lib\site-packages\setuptools\_distutils\dist.py", line 992, in run_command
cmd_obj.run()
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 39, in run
self.build_extension(ext)
File "C:\Users\halda\AppData\Local\Temp\pip-install-onyki_zr\python-poppler_a0472eeab1dd487f8486d308273da89b\setup.py", line 68, in build_extension
subprocess.check_call(
File "C:\ProgramData\Anaconda3\lib\subprocess.py", line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp', '-DPYTHON_EXECUTABLE=C:\\ProgramData\\Anaconda3\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\halda\\AppData\\Local\\Temp\\pip-install-onyki_zr\\python-poppler_a0472eeab1dd487f8486d308273da89b\\build\\lib.win-amd64-cpython-39\\poppler\\cpp', '-A', 'x64']' returned non-zero exit status 1.
[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.
╰─> python-poppler
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Edit: Updating the error I get even after installing the cmake
like the line
RuntimeError: CMake must be installed to build the following extensions: poppler.cpp.modules
says I would try to install cmake and then run it again
you can install it via
pip install cmake
Related
I want to create a Python module using pybind11 from a C++ code. In my case, the leading directory is called process_hclust. Inside, there is a src folder that possesses the needed C++ files.
* process_hclust (main folder)
| setup.py
| CMakeLists.txt
* src
| main.cpp
** hclust-cpp
| CMakeLists.txt
| fastcluster.h
| fastcluster.cpp
The main CMakeLists.txt adds the pybind11 module in "src/main.cpp" and links the library needed in the second CMakeLists.txt (as I understand).
cmake_minimum_required(VERSION 3.22.1)
project(process_hclust)
include(FetchContent)
FetchContent_Declare(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11
GIT_TAG v2.2.3
)
FetchContent_GetProperties(pybind11)
if(NOT pybind11_POPULATED)
FetchContent_Populate(pybind11)
add_subdirectory(${pybind11_SOURCE_DIR} ${pybind11_BINARY_DIR})
endif()
pybind11_add_module(${PROJECT_NAME} src/main.cpp)
add_subdirectory(src/hclust-cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE fastcluster)
The second. CMakeLists.txt file inside hclust-cpp declares which files need to be linked.
add_library(fastcluster fastcluster.cpp fastcluster.h)
Inside the main.cpp file, I am calling the header files using
#include "hclust-cpp/fastcluster.h"
The setup.py just calls cmake.
This code works on my local computer where I have python3.9 installed. It works by simple using:
pip install ./process_hclust
However, installing the module using my university machines with python3.7, I get the following error:
Processing ./cpp/process_hclust
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for process-hclust, since package 'wheel' is not installed.
Installing collected packages: process-hclust
Attempting uninstall: process-hclust
Found existing installation: process-hclust 0.0.0
Uninstalling process-hclust-0.0.0:
Successfully uninstalled process-hclust-0.0.0
Running setup.py install for process-hclust ... error
error: subprocess-exited-with-error
× Running setup.py install for process-hclust did not run successfully.
│ exit code: 1
╰─> [57 lines of output]
running install
running build
running build_ext
-- pybind11 v2.2.3
-- Configuring done
-- Generating done
-- Build files have been written to: /afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/cpp/process_hclust/build/temp.linux-x86_64-3.7/process_hclust
Consolidate compiler generated dependencies of target fastcluster
[ 50%] Built target fastcluster
Consolidate compiler generated dependencies of target process_hclust
[ 75%] Linking CXX shared module ../../lib.linux-x86_64-3.7/process_hclust.cpython-37m-x86_64-linux-gnu.so
/usr/bin/ld: src/hclust-cpp/libfastcluster.a(fastcluster.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZTI9nan_error' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/process_hclust.dir/build.make:98: ../../lib.linux-x86_64-3.7/process_hclust.cpython-37m-x86_64-linux-gnu.so] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/process_hclust.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
Traceback (most recent call last):
File "<string>", line 36, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/cpp/process_hclust/setup.py", line 137, in <module>
python_requires=">=3.6",
File "/afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/core.py", line 148, in setup
dist.run_commands()
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/command/install.py", line 545, in run
self.run_command('build')
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 78, in run
_build_ext.run(self)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/command/build_ext.py", line 340, in run
self.build_extensions()
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/command/build_ext.py", line 449, in build_extensions
self._build_extensions_serial()
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/distutils/command/build_ext.py", line 474, in _build_extensions_serial
self.build_extension(ext)
File "/afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/cpp/process_hclust/setup.py", line 122, in build_extension
subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=build_temp)
File "/opt/crc/p/python/3.7.3/gcc/lib/python3.7/subprocess.py", line 347, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.']' returned non-zero exit status 2.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
Rolling back uninstall of process-hclust
Moving to /afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/process_hclust-0.0.0-py3.7.egg-info
from /afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/~rocess_hclust-0.0.0-py3.7.egg-info
Moving to /afs/crc.nd.edu/user/j/jmarti53/Public/brain_project/LINKPROJECT/python/env/lib/python3.7/site-packages/process_hclust.cpython-37m-x86_64-linux-gnu.so
from /tmp/pip-uninstall-2ijatdvx/process_hclust.cpython-37m-x86_64-linux-gnu.so
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> process-hclust
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I believe the main problem is in the line
[ 75%] Linking CXX shared module ../../lib.linux-x86_64-3.7/process_hclust.cpython-37m-x86_64-linux-gnu.so
/usr/bin/ld: src/hclust-cpp/libfastcluster.a(fastcluster.cpp.o): relocation R_X86_64_32 against hidden symbol `_ZTI9nan_error' can not be used when making a shared object
/usr/bin/ld: final link failed: Nonrepresentable section on output
My small knowledge of pybind11, cmake, and building up Python libraries makes me think that the problem appears when the program links the hclust-cpp directory, looking for the fastcluster.h header. Still, I don't understand completely what is happening.
I have been trying to solve this problem for some days, so any suggestion for what to do would be highly appreciated; and in case the problem is confusing and/or need more information, just let me know.
I solved the problem. It got solved by adding SHARED into the second CMakeLists.txt
add_library(fastcluster SHARED fastcluster.cpp fastcluster.h)
Now, it works.
I have struggled for weeks now trying to install dlib.
After watching many videos and reading a stack overflow, I feel like I did something wrong.
OS: Windows 10
Python: 3.8.2 amd_64
*Note, I did install cmake with the 64 and later 32 bit versions from the cmake website, but to no avail. I tried the VS method, (didn't work). I installed the cmake library via pip install cmake without any errors. I find that strange.
I tried everything, but it keeps throwing errors at me, for example earlier it said that my 32 bit Python was incompatible with the 64 bit cmake; then I installed 64 bit Python, same error; tried a 32 bit cmake, same error; then tried to find a wheel for my system (I didn't find one); tried to build my own... and here's where it gets strange.
Could anyone please help me understand what this message is trying to say, better yet, could someone help me make it work, better yet, help me with my issue.
I suspect my PATH may have something to do with it?
C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0>python -m setup.py build
running build
running build_py
package init file 'dlib\__init__.py' not found (or not a regular file)
running build_ext
Invoking CMake setup: 'cmake C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Markian\Down
loads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\build\lib.win-amd64-3.8 -DPYTHON_EXECUTABLE=C:\Users\Markian\AppData\Local\Programs\Python\Python38\python.exe -DCMAK
E_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\build\lib.win-amd64-3.8 -A x64'
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error in CMakeLists.txt:
No CMAKE_C_COMPILER could be found.
CMake Error in CMakeLists.txt:
No CMAKE_CXX_COMPILER could be found.
-- Configuring incomplete, errors occurred!
See also "C:/Users/Markian/Downloads/dlib-19.9.0.tar/dist/dlib-19.9.0/dlib-19.9.0/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Markian/Downloads/dlib-19.9.0.tar/dist/dlib-19.9.0/dlib-19.9.0/build/temp.win-amd64-3.8/Release/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 184, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 110, in _get_module_details
__import__(pkg_name)
File "C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\setup.py", line 204, in <module>
setup(
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\site-packages\setuptools\__init__.py", line 145, in setup
return distutils.core.setup(**attrs)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 966, in run_commands
self.run_command(cmd)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\distutils\dist.py", line 985, in run_command
cmd_obj.run()
File "C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\setup.py", line 119, in run
self.build_extension(ext)
File "C:\Users\Markian\Downloads\dlib-19.9.0.tar\dist\dlib-19.9.0\dlib-19.9.0\setup.py", line 153, in build_extension
subprocess.check_call(cmake_setup, cwd=build_folder)
File "C:\Users\Markian\AppData\Local\Programs\Python\Python38\lib\subprocess.py", line 364, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\Markian\\Downloads\\dlib-19.9.0.tar\\dist\\dlib-19.9.0\\dlib-19.9.0\\tools\\python', '-DCMAKE_LIBRARY_OUTP
UT_DIRECTORY=C:\\Users\\Markian\\Downloads\\dlib-19.9.0.tar\\dist\\dlib-19.9.0\\dlib-19.9.0\\build\\lib.win-amd64-3.8', '-DPYTHON_EXECUTABLE=C:\\Users\\Markian\\AppData
\\Local\\Programs\\Python\\Python38\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\Markian\\Downloads\\dlib-19.9.0.tar\\dist\\dlib-19.9.0\\dlib-19.9
.0\\build\\lib.win-amd64-3.8', '-A', 'x64']' returned non-zero exit status 1.
I have no experience with subprocess.
Could anyone maybe point me towards a cp38 amd64 windows wheel for dlib?
When installing "pip3 install pycrypto" I have this error:
creating build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/AllOrNothing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/Chaffing.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/KDF.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
copying lib/Crypto/Protocol/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Protocol
creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
creating build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/tmp/pip-build-71pdfh2i/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 456, in <module>
core.setup(**kw)
File "/core.py", line 148, in setup
File "/dist.py", line 955, in run_commands
File "/dist.py", line 974, in run_command
File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/install.py", line 545, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/build.py", line 135, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/tmp/pip-build-71pdfh2i/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-71pdfh2i/pycrypto/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-cbi74gir-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-71pdfh2i/pycrypto/
My mount:
root#router2:~# mount
/dev/root on / type squashfs (ro,relatime)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
ramfs on /tmp type ramfs (rw,relatime)
none on /dev type tmpfs (rw,relatime,size=512K)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
devpts on /proc/bus/usb type usbfs (rw,relatime)
/dev/sda1 on /opt type ext4 (rw,relatime,data=ordered)
/dev/sda1 on /tmp/mnt/sda1 type ext4 (rw,relatime,data=ordered)
When using TMPDIR=/opt/tmp pip3 install pycrypto I also have problem (google showed that TMPDIR must be mounted without "noexec"):
creating build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/pubkey.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/_slowmath.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/RSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/DSA.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
copying lib/Crypto/PublicKey/ElGamal.py -> build/lib.linux-armv7l-3.6/Crypto/PublicKey
creating build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_v1_5.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/PKCS1_PSS.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
copying lib/Crypto/Signature/__init__.py -> build/lib.linux-armv7l-3.6/Crypto/Signature
warning: PCTBuildPy: byte-compiling is disabled, skipping.
running build_ext
running build_configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/opt/tmp/pip-build-ve5o0p9a/pycrypto':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 456, in <module>
core.setup(**kw)
File "/core.py", line 148, in setup
File "/dist.py", line 955, in run_commands
File "/dist.py", line 974, in run_command
File "/opt/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
return orig.install.run(self)
File "/install.py", line 545, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/build.py", line 135, in run
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 251, in run
self.run_command(cmd_name)
File "/cmd.py", line 313, in run_command
File "/dist.py", line 974, in run_command
File "/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
----------------------------------------
Command "/opt/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/opt/tmp/pip-build-ve5o0p9a/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /opt/tmp/pip-xa11ohvn-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /opt/tmp/pip-build-ve5o0p9a/pycrypto/
gcc, autoconf, automake, python3-dev, python3-pip, python-crypto, python-cryptography were installed.
opkg install gcc, autoconf automake python3-dev, python3-pip, python-crypto, python-cryptography
I tried set HOME=/opt/tmp and TMPDIR=/opt/tmp
or HOME=/opt/tmp TMPDIR=/opt/tmp pip3 install pycrypto
but the problem is the same as above.
I read https://github.com/Entware-ng/Entware-ng/wiki/Self-installation-of-python-modules and follow it but wasn't successful.
pycrypto is requirement xiaomi component of hass
Please note that this is for python 3 not python 2.
Platform:
Buffalo WZR-1750DHP
Firmware: DD-WRT v3.0-r33006 std (08/03/17)
Please advise how to fix this issue.
Thank you!
I have inherited an Open Embedded / Yocto based project for which I need to amend the OS image. I would like to add a new python module - pycrypto. The project builds just fine before I make changes.
I have added the following BitBake recipe for pycrypto:
DESCRIPTION = "Python crypto"
SECTION = "devel/python"
LICENSE = "PD"
SRC_URI = "https://pypi.python.org/packages/source/p/pycrypto/pycrypto-${PV}.tar.gz"
SRC_URI[md5sum] = "55a61a054aa66812daf5161a0d5d7eda"
SRC_URI[sha256sum] = "f2ce1e989b272cfcb677616763e0a2e7ec659effa67a88aa92b3a65528f60a3c"
LIC_FILES_CHKSUM = "file://README;md5=453a552a607fd82384e25db312340e9a"
S = "${WORKDIR}/pycrypto-${PV}"
inherit setuptools
as python-crypto_2.6.1.bb.
I then use this in my main OS image recipe:
PYTHON_INSTALL = " \
python-ctypes python-subprocess python-threading python-json \
python-pyopenssl python-audio python-bsddb python-codecs python-compile python-compiler python-compression python-core python-crypt python-curses python-datetime python-db python-debugger python-dev python-difflib python-distutils python-doctest python-elementtree python-email python-fcntl python-gdbm python-hotshot python-html python-idle python-image python-io python-lang python-logging python-mailbox python-math python-mime python-mmap python-multiprocessing python-netclient python-netserver python-numbers python-pickle python-pkgutil python-pprint python-profile python-pydoc python-re python-readline python-resource python-robotparser python-shell python-smtpd python-sqlite3 python-sqlite3-tests python-stringold python-syslog python-terminal python-tests python-textutils python-tkinter python-unittest python-unixadmin python-xml python-xmlrpc python-zlib python-modules python-pyserial python-misc python-mysql python-crypto\
"
When the build executes (bitbake my-image), everything seems to go fine retrieving the sources for pycrypto. However after compilation, configure attempts to run the cross compiled program - which doesn't work (it's built for a different architecture) and stops bitbake creating my image.
Here's the logfile:
DEBUG: Executing shell function do_compile
running build
running build_py
running build_ext
running build_configure
checking for gcc... arm-poky-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/media/parallels/build/tmp/sysroots/overo
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/python-crypto/2.6.1-r0/pycrypto-2.6.1':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Traceback (most recent call last):
File "setup.py", line 456, in <module>
core.setup(**kw)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 251, in run
self.run_command(cmd_name)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/media/parallels/build/tmp/sysroots/x86_64-linux/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 278, in run
raise RuntimeError("autoconf error")
RuntimeError: autoconf error
ERROR: python setup.py build_ext execution failed.
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile (log file is located at /media/parallels/build/tmp/work/cortexa8hf-vfp-neon-poky-linux-gnueabi/python-crypto/2.6.1-r0/temp/log.do_compile.6553)
I'm building from an x64 host and targeting an ARM processor.
The advice in the logfile seems reasonable - "If you meant to cross compile, use `--host'." - the only problem is where do I use --host?
Also, it's a bit disconcerting that a search of the existing project sources reveal no other instances of --host being used and it all builds for ARM just fine so maybe this message is leading me astray.
Can anyone help with configuring BitBake/automake/whatever-part-of-the-Open-Embedded-toolchain so that once my module has been cross compiled it doesn't then try to execute it on my host machine (wrong architecture)?
Thanks!
layers.openembedded.org is your friend: http://git.yoctoproject.org/cgit/cgit.cgi/meta-security/tree/recipes-devtools/python/python-pycrypto_2.6.1.bb?h=master
This needs to be reviewed and ideally moved to meta-python, but it should work. Specifically I see that it includes autotools which then does the cross-compilation magic for you.
I am new to Python and want to be able to use my existing Fortran code and run it from Python. I am trying to compile a small "Hello world" Fortran program using F2PY by following instructions online.
I am working on Windows. So far I have installed Python 2.7.3, NumPy 1.6.1, SciPy 10.1, and MinGW 4.8.
I then tried (amongst other things)
f2py.py -c --compiler=mingw32 --fcompiler=gnu95 -m foo foo.f90
This reports an invalid version number.
ValueError: invalid version number '4.'
If anyone could suggest what is going wrong and what I would need to change to get this to run I would be most grateful. The full output from F2PY is follows:
D:\python\fortran2>f2py.py -c --compiler=mingw32 --fcompiler=gnu95 -m foo foo.f90
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "foo" sources
f2py options: []
f2py:> c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7\foomodule.c
creating c:\docume~1\ajr\locals~1\temp\tmpwvnr2c
creating c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7
Reading fortran codes...
Reading file 'foo.f90' (format:free)
Post-processing...
Block: foo
Block: hello
Post-processing (stage 2)...
Building modules...
Building module "foo"...
Constructing wrapper function "hello"...
hello()
Wrote C/API module "foo" to file "c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7\foomodule.c"
adding 'c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7\fortranobject.c' to sources.
adding 'c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7' to include_dirs.
copying C:\Python27\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7
copying C:\Python27\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\docume~1\ajr\locals~1\temp\tmpwvnr2c\src.win32-2.7
build_src: building npy-pkg config files
running build_ext
Traceback (most recent call last):
File "c:\python27\scripts\f2py.py", line 24, in <module>
main()
File "C:\Python27\lib\site-packages\numpy\f2py\f2py2e.py", line 588, in main
run_compile()
File "C:\Python27\lib\site-packages\numpy\f2py\f2py2e.py", line 574, in run_compile
setup(ext_modules = [ext])
File "C:\Python27\lib\site-packages\numpy\distutils\core.py", line 186, in setup
return old_setup(**new_attr)
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\numpy\distutils\command\build.py", line 37, in run
old_build.run(self)
File "C:\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\site-packages\numpy\distutils\command\build_ext.py", line 92, in run
force=self.force)
File "C:\Python27\lib\site-packages\numpy\distutils\ccompiler.py", line 556, in new_compiler
compiler = klass(None, dry_run, force)
File "C:\Python27\lib\site-packages\numpy\distutils\mingw32ccompiler.py", line 127, in __init__
elif self.gcc_version < "4.":
File "C:\Python27\lib\distutils\version.py", line 138, in __cmp__
other = StrictVersion(other)
File "C:\Python27\lib\distutils\version.py", line 40, in __init__
self.parse(vstring)
File "C:\Python27\lib\distutils\version.py", line 107, in parse
raise ValueError, "invalid version number '%s'" % vstring
ValueError: invalid version number '4.'
The distutils plugin for mingw32 uses an incompatible version string. In distutils/version.py, line 100, the version string matching regex is
r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$'
Edit the file mingw32ccompiler.py manually and change line 127 to read
elif self.gcc_version < "4.0":