2017-02-02 8 views
1

私はPython 3.6を使用しています。私は、コマンドを経由してImportError:Python 3.6のcomtypesというモジュールがありません

python -m pip install comtypes 
Requirement already satisfied: comtypes in c:\users\singtech\appdata\local\programs\python\python36-32\lib\site-packages 

をモジュールcomtypesをインストールしているしかし、私はまだ私のスクリプトからcomtypesのインポートエラーを取得しています:

import comtypes.client as cc 
import comtypes 

mylib = cc.GetModule("d:\\path\\to\\mylib.dll") 
print(mylib) 

私はスクリプトを実行すると、それは次のエラーを生成します。

Traceback (most recent call last): 
    File "D:\python-apps\aos.py", line 1, in <module> 
    import comtypes.client as cc 
ImportError: No module named 'comtypes' 
+0

スクリプトをどのように実行しますか? –

+0

[Thonny IDE](http://thonny.org/)でスクリプトを実行します – Sithu

+2

スクリプトを実行するために使用される別のインタプリタでパッケージをインストールしました。 –

答えて

1

私はPython初心者のIDE Thonnyでスクリプトを実行します。別のインタプリタを使用します。 IDEのオプションで正しいインタプリタパスを設定すると、インポートエラーが消えてしまいました。

enter image description here

関連する問題