Wie installieren von pywin32 in virtualenv mit python 2.7 64-bit?
Frage ich mich, richtigen Weg zu installieren, auf virtualenv mit 64-bit-python 2.7 pywin32 Modul (Betriebssystem ist Windows 7 64 bit).
Ich habe festgestellt, exe-installer auf Sourceforge.
Wenn ich easy_installer auf der Kommandozeile zuerst geht alles gut, aber bald sehe ich ein merkwürdiges Verhalten: während pywin32-216.win-amd64-py2.7 installiert, es läuft pywin32-216-py2.7-win32.ei und schlägt es fehl, mit dem Fehler:
No local packages or download links found for pywin32==216
Best match: None
Und hier ist meine komplette log:
(sandbox_virtenv) D:\test\py2exe_test>easy_install http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win-amd64-py2.7.exe
Downloading http://sourceforge.net/projects/pywin32/files/pywin32/Build216/pywin32-216.win-amd64-py2.7.exe
Processing pywin32-216.win-amd64-py2.7.exe
pywintypes: module references __file__
win32evtlogutil: module references __file__
win32serviceutil: module references __file__
win32timezone: module references __file__
Demos.win32rcparser_demo: module references __file__
Demos.security.sspi.validate_password: module references __file__
isapi.install: module references __file__
isapi.samples.advanced: module references __file__
isapi.samples.test: module references __file__
isapi.test.setup: module references __file__
pywin.framework.scriptutils: module references __file__
pywin.framework.startup: module references __path__
pywin.scintilla.config: module references __path__
pywin.scintilla.control: module references __file__
pywin.scintilla.IDLEenvironment: module references __file__
scripts.regsetup: module references __file__
scripts.setup_d: module references __file__
test.testall: module references __file__
test.test_clipboard: module references __file__
test.test_win32api: module references __file__
test.test_win32rcparser: module references __file__
D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\bdist_egg.py:422: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
symbols = dict.fromkeys(iter_symbols(code))
test.test_win32trace: module references __file__
win32com.__init__: module references __path__
win32com.server.register: module references __file__
win32com.server.register: module references __path__
win32com.test.GenTestScripts: module references __path__
win32com.test.pippo_server: module references __file__
win32com.test.testall: module references __file__
win32com.test.testAXScript: module references __path__
win32com.test.testDictionary: module references __file__
win32com.test.testPippo: module references __file__
win32com.test.testPyComTest: module references __file__
win32com.test.testServers: module references __file__
win32com.test.util: module references __file__
win32comext.adsi.__init__: module references __path__
win32comext.authorization.__init__: module references __path__
win32comext.axcontrol.__init__: module references __path__
win32comext.axdebug.codecontainer: module references __file__
win32comext.axdebug.debugger: module references __file__
win32comext.axdebug.__init__: module references __path__
win32comext.axscript.__init__: module references __path__
win32comext.bits.__init__: module references __path__
win32comext.directsound.__init__: module references __path__
win32comext.directsound.test.ds_test: module references __file__
win32comext.internet.__init__: module references __path__
win32comext.mapi.__init__: module references __path__
win32comext.shell.__init__: module references __path__
win32comext.shell.demos.servers.empty_volume_cache: module references __file__
win32comext.shell.demos.servers.folder_view: module references __file__
win32comext.taskscheduler.__init__: module references __path__
creating 'c:\users\antp~1.kyi\appdata\local\temp\easy_install-kclmxk\pywin32-216-py2.7-win32.egg' and adding 'c:\users\antp~1.kyi\appdata\local\temp\easy_install-kclmxk\pywin32-216-py2.7-win32.egg.tmp' to it
creating d:\test\sandbox_virtenv\lib\site-packages\pywin32-216-py2.7-win32.egg
Extracting pywin32-216-py2.7-win32.egg to d:\test\sandbox_virtenv\lib\site-packages
Adding pywin32 216 to easy-install.pth file
Installing pywin32_postinstall.py script to D:\test\sandbox_virtenv\Scripts
Installing pywin32_postinstall.pyc script to D:\test\sandbox_virtenv\Scripts
Installing pywin32_testall.py script to D:\test\sandbox_virtenv\Scripts
Installing pywin32_testall.pyc script to D:\test\sandbox_virtenv\Scripts
Installed d:\test\sandbox_virtenv\lib\site-packages\pywin32-216-py2.7-win32.egg
Processing dependencies for pywin32==216
Searching for pywin32==216
Reading http://pypi.python.org/simple/pywin32/
Reading http://sf.net/projects/pywin32
Reading https://sourceforge.net/projects/pywin32/files/pywin32/
Reading http://sourceforge.net/project/showfiles.php?group_id=78018
No local packages or download links found for pywin32==216
Best match: None
Traceback (most recent call last):
File "D:\test\sandbox_virtenv\Scripts\easy_install-script.py", line 8, in <module>
load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 1712, in main
with_ei_usage(lambda:
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 1700, in with_ei_usage
return f()
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 1716, in <lambda>
distclass=DistributionWithoutHelpCommands, **kw
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 "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 211, in run
self.easy_install(spec, not self.no_deps)
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 422, in easy_install
return self.install_item(None, download, tmpdir, deps, True)
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 478, in install_item
self.process_distribution(spec, dist, deps)
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 519, in process_distribution
[requirement], self.local_index, self.easy_install
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 563, in resolve
dist = best[req.key] = env.best_match(req, self, installer)
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 799, in best_match
return self.obtain(req, installer) # try and download/install
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 811, in obtain
return installer(requirement)
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\command\easy_install.py", line 434, in easy_install
self.local_index
File "D:\test\sandbox_virtenv\lib\site-packages\setuptools-0.6c11-py2.7.egg\setuptools\package_index.py", line 475, in fetch_distribution
return dist.clone(location=self.download(dist.location, tmpdir))
AttributeError: 'NoneType' object has no attribute 'clone'
(sandbox_virtenv) D:\test\py2exe_test>
Nun kann ich den import von python-win32api-und es ist ziemlich verwirrend
(sandbox_virtenv) D:\test\py2exe_test>python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import win32api
>>>
Wenn Sie hier etwas unklar, Fragen Sie mich. Vielen Dank für deine Ratschläge.
InformationsquelleAutor tony | 2011-11-10
Du musst angemeldet sein, um einen Kommentar abzugeben.
Ich dachte, dies aus, aber der Prozess ist nicht angenehm.
Gibt es 3 Probleme mit der PyWin32-installer:
Wenn Sie also das ausführen von 64-bit-python 2.7 auf windows 64 bit oder 32 auf 32 und Ihre virtuelle Umgebung in c:\scratch\env1\ der Prozess sieht wie folgt aus:
Dies funktioniert gut genug, um zu laufen django-mssql in der virtuellen Umgebung ohne pywin32 installiert, die außerhalb der virtuellen Umgebung.
Ich Gesicht
import win32service as ws ImportError no module found
wenn ich Schritt 6. wenn Sie versuchen, zu starten odoo Debuggen in eclipse. ich denke, dass dieser Schritt nicht getan werden sollte.InformationsquelleAutor Peter Johnson
Mit den neuesten virtualenv-1.7.1.2, sollten Sie das virtualenv mit der
--distribute
Flagge. Ich schaffte es zu lösen, die genau das gleiche problem Sie hatte, indem die Flagge.Auf ein zugehöriger Hinweis, auf einem anderen Rechner (Gleiches OS, Windows Server 2008 R2), ich hatte zum erstellen der virtualenv ohne die
--distribute
fahne, die sonst immer, wenn ich laufeneasy_install
eine neue Eingabeaufforderung öffnet.Virtualenv auf Windows ist wie eine dunkle Kunst.
--distribute
flag ist veraltet und hat jetzt nichts.InformationsquelleAutor sayap
Leider, die Unterstützung für 64-bit-Python unter Windows ist relativ schlechter als die 32bit-version. Es ist nicht die Schuld der Python-community, sondern die relative Schwierigkeit, freie Compiler für 64-bit-Windows.
Wenn Sie installiert die 64bit version von Python, müssen Sie zusätzlich die Pakete verwenden, gebaut für 64bit. Einige einfache Python-Pakete (die in reinem Python und nicht die externe/C-libraries) installieren Sie wie gewohnt mit setuptools/easy_install/virtualenv. Eine Menge von 64bit-Pakete jedoch könnte brechen, wenn installiert in virtualenv und erfordern einen installer.
Glücklicherweise können Sie finden 64bit vorkompilierte Installer für beliebte Pakete hier. Versuchen das Paket dort zuerst. Der installer Ziel der globalen/main installation von Python und ist somit nicht isoliert von virtualenv. Beachten Sie jedoch, dass diese inoffizielle baut: kostenlos zur Verfügung gestellt, für Ihre Bequemlichkeit, so bitte nicht verklagen den Anbieter, wenn die Dinge nicht (oder erwarten für die Hilfe).
Benutzen/starten .exe-installer (das Klick-Prozess), nicht mit easy_install. Ich bin mir nicht sicher über bauen 216/aktuellen build, aber ich war in der Lage zu installieren 64bit pywin32 auf Python 2.7 64-bit unter Windows 7, wie ein paar Monaten ohne Probleme. Lassen Sie mich wissen, wenn es immer noch nicht funktioniert... wahrscheinlich müssen wir betrachten, bug-tracker, wenn andere Menschen die gleichen Probleme.
yep, die installation ohne zusätzliches Werkzeug funktioniert gut, aber ich war auf der Suche für die installation dieser Erweiterung nur auf virtuellen Umgebung, ich möchte nicht auf meinem globalen python installation.
InformationsquelleAutor shimofuri
Dies ist eine alte Frage, aber Sie kommen über dieses problem vor kurzem und ich möchte zu teilen, was ich getan habe um diese Arbeit zu machen. Ich war auf der Suche nach python kerberos-Implementierung unter windows, und ich fand kerbeors_sspi verwendet pywin32.
dies alles installiert ist mit pip, aber pywin32 kann nicht installiert werden, mithilfe von pip innerhalb des virtualenv.
Also habe ich gepatcht, die kerberos_sspi Bibliothek zu benutzen pypiwin32, das ist ein Rad verpackt durch die Glyphe und el (twisted Schöpfer BTW). Und jetzt das ganze funktioniert wunderbar, noch, wenn Sie möchten den Zugriff auf die COM-Sachen, die Sie manuell installieren von pywin32, denn es muss im system registriert werden.
Hier ist der link zu der pypiwin32 index
Cheers,
InformationsquelleAutor e-nouri