1

Ich bin ziemlich neu zu Python und ich möchte das Modul "Lic_internal" mit Python 2.7.12 unter Windows 64bit verwenden, aber ich bekomme den folgenden Fehler:ImportError: Nicht finden vcvarsall.bat mit Python 2.7.12

Traceback (most recent call last): 
    File "04_report.py", line 32, in <module> 
import utils_show as ushow 
    File "./libs\utils_show.py", line 45, in <module> 
import lic_internal 
    File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 445, in load_module language_level=self.language_level) 
    File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 234, in load_module exec("raise exc, None, tb", {'exc': exc, 'tb': tb}) 
    File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 216, in load_module inplace=build_inplace, language_level=language_level) 
    File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 192, in build_module reload_support=pyxargs.reload_support) 
    File "D:\Programme\Python27\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll dist.run_commands() 
    File "D:\Programme\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) 
    File "D:\Programme\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() 
    File "D:\Programme\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 164, in run _build_ext.build_ext.run(self) 
    File "D:\Programme\Python27\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() 
    File "D:\Programme\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 172, in build_extension self.build_extension(ext) 
    File "D:\Programme\Python27\lib\distutils\command\build_ext.py", line 498, in build_extension depends=ext.depends) 
    File "D:\Programme\Python27\lib\distutils\msvc9compiler.py", line 474, in compile self.initialize() 
    File "D:\Programme\Python27\lib\distutils\msvc9compiler.py", line 384, in initialize vc_env = query_vcvarsall(VERSION, plat_spec) 
    File "D:\Programme\Python27\lib\distutils\msvc9compiler.py", line 272, in query_vcvarsall raise DistutilsPlatformError("Unable to find vcvarsall.bat") 

ImportError: Building module lic_internal failed: ['DistutilsPlatformError: Unable to find vcvarsall.bat\n'] 

ich habe "Visual C++ für Python 2.7" installiert und versucht, den Weg in ändern "Python27 \ lib \ distutils \ msvc9compiler.py" wie folgt:

def query_vcvarsall(version, arch="x86"): 
"""Launch vcvarsall.bat and read the settings from its environment 
""" 
vcvarsall = find_vcvarsall(version) 
vcvarsall = "C:/Users/Christian/AppData/Local/Programs/Common/Microsoft/Visual C++ for Python/9.0" + "/vcvarsall.bat" 
interesting = set(("include", "lib", "libpath", "path")) 

Was bedeutet, dass ich in „vcvarsall gespeichert "Der genaue Weg.

Dann bekomme ich folgende Fehlermeldung:

Traceback (most recent call last): 
File "04_report.py", line 32, in <module> import utils_show as ushow 
File "./libs\utils_show.py", line 45, in <module> import lic_internal 
File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 445, in load_module language_level=self.language_level) 
File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 234, in load_module exec("raise exc, None, tb", {'exc': exc, 'tb': tb}) 
File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 216, in load_module inplace=build_inplace, language_level=language_level) 
File "D:\Programme\Python27\lib\site-packages\pyximport\pyximport.py", line 192, in build_module reload_support=pyxargs.reload_support) 
File "D:\Programme\Python27\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll dist.run_commands() 
File "D:\Programme\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) 
File "D:\Programme\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() 
File "D:\Programme\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 164, in run _build_ext.build_ext.run(self) 
File "D:\Programme\Python27\lib\distutils\command\build_ext.py", line 339, in run self.build_extensions() 
File "D:\Programme\Python27\lib\site-packages\Cython\Distutils\build_ext.py", line 172, in build_extensions self.build_extension(ext) 
File "D:\Programme\Python27\lib\distutils\command\build_ext.py", line 498, in build_extension depends=ext.depends) 
File "D:\Programme\Python27\lib\distutils\msvc9compiler.py", line 549, in compile raise CompileError(msg) 

ImportError: Building module lic_internal failed: ["CompileError: command 'C:\\\\Users\\\\Christian\\\\AppData\\\\Local\\Programs\\\\Common\\\\Microsoft\\\\Visual C++ for Python\\\\9.0\\\\VC\\\\Bin\\\\cl.exe' failed with exit status 2\n"] 

Außerdem habe ich Visual C++ 2013 auf meinem Computer installiert, aber als ich das C++ Compiler-Paket für Python heruntergeladen sollte es nicht notwendig sein, nicht wahr?

Antwort

-1

Wenn Sie immer noch das Problem haben, löste ich es durch die Deinstallation anderer Pythons im System. Zur Sicherheit müssen Sie den Pfad des Pythons definieren, mit dem Sie arbeiten möchten, indem Sie https://stackoverflow.com/a/30272728/7497110 verwenden, dann öffnen Sie die msvc9compiler.py und tun dies https://github.com/cython/cython/wiki/CythonExtensionsOnWindows. Dann könnten Sie das bekannte Header-Problem (d. H. * .h Keine solche Datei oder Verzeichnis) bekommen. In diesem Fall können Sie die Anweisungen in http://www.pythonlibrary.org/notes/open_glcontext_notes.htm verwenden. Denken Sie daran, die Python insbesondere die Distutils und numpy zu aktualisieren. Bitte lassen Sie mich wissen, wenn das Problem gelöst ist.

+0

Willkommen bei Stack Overflow! Bitte fügen Sie _Me auch nicht _ als Antworten hinzu. Sie liefert keine Antwort auf die Frage und kann von zukünftigen Besuchern als Lärm empfunden werden. Wenn Sie eine andere, aber verwandte Frage haben, dann [fragen] (http://stackoverflow.com/questions/ask) es (referenzieren Sie dieses, wenn es helfen wird, Kontext zur Verfügung zu stellen). Wenn Sie an dieser speziellen Frage interessiert sind, können Sie [upvote] (http://stackoverflow.com/help/privileges/vote-up) es oder lassen Sie einen [Kommentar] (http://stackoverflow.com/help/) Privilegien/Kommentar) sobald du genug [Reputation] hast (http://stackoverflow.com/help/whats-reputation). – Tunaki

Verwandte Themen