2017-02-27 10 views
0

をインポートすることができませんでした:私は私のPythonのバージョンをチェックし、私は同じとしてこれを見ることができたPythonのインストールパッケージが、私は再インストールしようと、次のメッセージ持っている

Requirement already satisfied: troposphere==1.8.2 in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 13) 

を:

animjain$ python -V 
Python 2.7.10 

私はモジュールをインポートしようとすると、次のエラーを取得:あなたはあなたのマシン上で複数のPythonのバージョンを持っている場合は

animjain$ python 
Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from troposphere import Join, Ref, FindInMap 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named troposphere 
+1

を実行することができ、あなたのマシン上でのpythonの複数のバージョンがありますか? – WhatsThePoint

+0

はい複数のバージョンのPythonが動作しています。私は以下のことがうまくいくかどうかを試してみるつもりです。何かを追加したい場合は、 –

+0

を実行してください。複数のバージョンのPythonを実行している場合は、モジュールを間違ったバージョン – WhatsThePoint

答えて

1

を、イン同じPythonのコマンドを使用して、背が高く、その代わりに:

animjain$ pip install troposphere==1.8.2 

実行:

animjain$ python -mpip install troposphere==1.8.2 
1

あなたは、プロジェクトの依存関係をインストールするためにvirtualenvを使用する必要があります。グローバルサイトパッケージを塞ぐ必要はありません。例えば

sudo apt-get install virtualenv 
cd ~ 
virtualenv your_test_venv 
source your_test_venv/bin/activate 
pip install troposphere 

その後は、あなたの新しいパッケージを使用することができます。

あなたのvirtualenvのを無効にしたい場合は、コマンドdeactivate

関連する問題