헤르메스 LIFE

[Exception] error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ 본문

Exception

[Exception] error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

헤르메스의날개 2021. 12. 25. 17:06
728x90

jaydebeapi 는 Python 에서 Java JDBC를 이용할 수 있는 모듈입니다.

H2 Database 를 접속하기 위해 jaydebeapi 를 설치하던 중 아래와 같은 오류가 발생했습니다.

개발환경

Python : 3.10

        -> 3.9 버전으로 Downgrade 하시면 편안해집니다. ( 아직은 3.10 버전을 지원하지 않는 듯 합니다.)

Tools : PyCharm

pip install JayDeBeApi

Collecting jaydebeapi
  Using cached JayDeBeApi-1.2.3-py3-none-any.whl (26 kB)
Collecting JPype1
  Using cached JPype1-1.3.0.tar.gz (820 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: JPype1
  Building wheel for JPype1 (setup.py): started
  Building wheel for JPype1 (setup.py): finished with status 'error'
  Running setup.py clean for JPype1
Failed to build JPype1
Installing collected packages: JPype1, jaydebeapi
    Running setup.py install for JPype1: started
    Running setup.py install for JPype1: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: 'C:\JetBrains\pythonProjects\GUI_Project\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"'; __file__='"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\[USER]\AppData\Local\Temp\pip-wheel-m3ivxk83'
       cwd: C:\Users\[USER]\AppData\Local\Temp\pip-install-72ipnnyi\jpype1_6eb075fa3aae47c3a216a4e020b71399\
  Complete output (56 lines):
  Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
  Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
  Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.10
  creating build\lib.win-amd64-3.10\jpype
  copying jpype\beans.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\config.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\dbapi2.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\imports.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\nio.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\pickle.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\protocol.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\types.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_classpath.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_core.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_gui.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jarray.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jclass.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jcollection.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jcustomizer.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jexception.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jinit.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jio.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jmethod.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jobject.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jpackage.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jproxy.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jstring.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jthread.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jvmfinder.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\_pykeywords.py -> build\lib.win-amd64-3.10\jpype
  copying jpype\__init__.py -> build\lib.win-amd64-3.10\jpype
  package init file 'jpype\_pyinstaller\__init__.py' not found (or not a regular file)
  creating build\lib.win-amd64-3.10\jpype\_pyinstaller
  copying jpype\_pyinstaller\entry_points.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
  copying jpype\_pyinstaller\example.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
  copying jpype\_pyinstaller\hook-jpype.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
  copying jpype\_pyinstaller\test_jpype_pyinstaller.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
  copying jpype\_core.pyi -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jcollection.pyi -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jio.pyi -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jstring.pyi -> build\lib.win-amd64-3.10\jpype
  copying jpype\_jthread.pyi -> build\lib.win-amd64-3.10\jpype
  warning: build_py: byte-compiling is disabled, skipping.
  
  running build_ext
  Call build extensions
  Using Jar cache
  copying native\jars\org.jpype.jar -> build\lib.win-amd64-3.10
  Call build ext
  building '_jpype' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for JPype1
    ERROR: Command errored out with exit status 1:
     command: 'C:\JetBrains\pythonProjects\GUI_Project\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"'; __file__='"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\[USER]\AppData\Local\Temp\pip-record-voxtplv2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\JetBrains\pythonProjects\GUI_Project\venv\include\site\python3.10\JPype1'
         cwd: C:\Users\[USER]\AppData\Local\Temp\pip-install-72ipnnyi\jpype1_6eb075fa3aae47c3a216a4e020b71399\
    Complete output (56 lines):
    Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
    Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
    Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.10
    creating build\lib.win-amd64-3.10\jpype
    copying jpype\beans.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\config.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\dbapi2.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\imports.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\nio.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\pickle.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\protocol.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\types.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_classpath.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_core.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_gui.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jarray.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jclass.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcollection.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcustomizer.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jexception.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jinit.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jio.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jmethod.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jobject.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jpackage.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jproxy.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jstring.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jthread.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jvmfinder.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\_pykeywords.py -> build\lib.win-amd64-3.10\jpype
    copying jpype\__init__.py -> build\lib.win-amd64-3.10\jpype
    package init file 'jpype\_pyinstaller\__init__.py' not found (or not a regular file)
    creating build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\entry_points.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\example.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\hook-jpype.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_pyinstaller\test_jpype_pyinstaller.py -> build\lib.win-amd64-3.10\jpype\_pyinstaller
    copying jpype\_core.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jcollection.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jio.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jstring.pyi -> build\lib.win-amd64-3.10\jpype
    copying jpype\_jthread.pyi -> build\lib.win-amd64-3.10\jpype
    warning: build_py: byte-compiling is disabled, skipping.
    
    running build_ext
    Call build extensions
    Using Jar cache
    copying native\jars\org.jpype.jar -> build\lib.win-amd64-3.10
    Call build ext
    building '_jpype' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\JetBrains\pythonProjects\GUI_Project\venv\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"'; __file__='"'"'C:\\Users\\[USER]\\AppData\\Local\\Temp\\pip-install-72ipnnyi\\jpype1_6eb075fa3aae47c3a216a4e020b71399\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\[USER]\AppData\Local\Temp\pip-record-voxtplv2\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\JetBrains\pythonProjects\GUI_Project\venv\include\site\python3.10\JPype1' Check the logs for full command output.


단순히 Visual C++ 재배포 모듈만 설치하면 될 줄 알았던 내용이 안되서 여러 시도를 하게됐습니다.

 

1. Visual C++ 재배포 모듈 설치 - 2015 Version 이상을 설치해야 합니다.

노트북을 Reboot 합니다.

https://visualstudio.microsoft.com/ko/vs/older-downloads/

 

Visual Studio 이전 다운로드 - 2019, 2017, 2015 및 이전 버전

이전 버전의 Visual Studio Community, Professional 및 Enterprise 소프트웨어를 다운로드합니다. 여기에서 MSDN(Visual Studio) 구독에 로그인합니다.

visualstudio.microsoft.com

 

2. jaydebeapi-master.zip:https://codeload.github.com/baztian/jaydebeapi/zip/master

다운받아서 압축을 해제합니다. ( 저는 Temp 폴더에 압축을 풀었습니다. )

3. python setup.py install

더보기

C:\>cd C:\Temp\jaydebeapi-master\jaydebeapi-master

C:\Temp\jaydebeapi-master\jaydebeapi-master>python setup.py install
running install
running bdist_egg
running egg_info
creating JayDeBeApi.egg-info
writing JayDeBeApi.egg-info\PKG-INFO
writing dependency_links to JayDeBeApi.egg-info\dependency_links.txt
writing requirements to JayDeBeApi.egg-info\requires.txt
writing top-level names to JayDeBeApi.egg-info\top_level.txt
writing manifest file 'JayDeBeApi.egg-info\SOURCES.txt'
reading manifest file 'JayDeBeApi.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.py' under directory 'src\test'
warning: no files found matching '*.sql' under directory 'src\test'
no previously-included directories found matching '*~'
adding license file 'COPYING'
adding license file 'COPYING.LESSER'
writing manifest file 'JayDeBeApi.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
running build_py
creating build
creating build\lib
creating build\lib\jaydebeapi
copying jaydebeapi\__init__.py -> build\lib\jaydebeapi
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
creating build\bdist.win-amd64\egg\jaydebeapi
copying build\lib\jaydebeapi\__init__.py -> build\bdist.win-amd64\egg\jaydebeapi
byte-compiling build\bdist.win-amd64\egg\jaydebeapi\__init__.py to __init__.cpython-310.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying JayDeBeApi.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying JayDeBeApi.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying JayDeBeApi.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying JayDeBeApi.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying JayDeBeApi.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist\JayDeBeApi-1.2.3-py3.10.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing JayDeBeApi-1.2.3-py3.10.egg
Removing c:\python\python310\lib\site-packages\JayDeBeApi-1.2.3-py3.10.egg
Copying JayDeBeApi-1.2.3-py3.10.egg to c:\python\python310\lib\site-packages
JayDeBeApi 1.2.3 is already the active version in easy-install.pth

Installed c:\python\python310\lib\site-packages\jaydebeapi-1.2.3-py3.10.egg
Processing dependencies for JayDeBeApi==1.2.3
Searching for JPype1
Reading https://pypi.org/simple/JPype1/
Downloading https://files.pythonhosted.org/packages/57/4f/3cddc9b9cd892bbe098e5d48ed3a8aaa02dd3fa732612065fa6b0fab0062/JPype1-1.3.0.tar.gz#sha256=4fc27dba89750cb0c9d692466341ce60c0fe86a16051091cb5347a37cf884151
Best match: JPype1 1.3.0
Processing JPype1-1.3.0.tar.gz
Writing C:\Users\JONGYO~1.PAR\AppData\Local\Temp\easy_install-0zr6d_gd\JPype1-1.3.0\setup.cfg
Running JPype1-1.3.0\setup.py -q bdist_egg --dist-dir C:\Users\JONGYO~1.PAR\AppData\Local\Temp\easy_install-0zr6d_gd\JPype1-1.3.0\egg-dist-tmp-rfffgwbz
Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
Falling back to provided JNI headers, since your provided JAVA_HOME "C:\java\openjdk11.28_-x64" does not provide jni.h
package init file 'jpype\_pyinstaller\__init__.py' not found (or not a regular file)
warning: no files found matching '*.class' under directory 'native'
Call build extensions
Call build ext
error: Setup script exited with error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

아직도 오류 메시지는 보여지네요. ㅡㅡㅋ

하지만... 설치는 됐습니다.


https://pypi.org/project/JayDeBeApi/

 

JayDeBeApi

Use JDBC database drivers from Python 2/3 or Jython with a DB-API.

pypi.org

 

 

728x90