我試圖在虛擬環境中安裝pymongo,和PIP說,它的安裝,但它並不顯得:皮普說,pymongo已經安裝,但不顯示它作爲安裝
(venv)$ ./myapp.py
Traceback (most recent call last):
File "./myapp.py", line 5, in <module>
import myAppMongo
File "/home/me/python/myapp/myAppMongo.py", line 4, in <module>
from pymongo import MongoClient
ImportError: No module named 'pymongo'
我已經安裝了pymongo:
(venv)$ pip --no-cache install pymongo
Collecting pymongo
Downloading pymongo-3.2.tar.gz (473kB)
100% |████████████████████████████████| 475kB 18.3MB/s
Installing collected packages: pymongo
Running setup.py install for pymongo ... done
Successfully installed pymongo
但它不會出現在PIP的凍結輸出:
(venv)$ pip freeze |grep -ic pymongo
0
我跑亞馬遜的Linux與他們的Python 3套餐:
(venv)$ sudo yum list installed|grep -i python3
python34.x86_64 3.4.3-1.30.amzn1 @amzn-main
python34-devel.x86_64 3.4.3-1.30.amzn1 @amzn-main
python34-libs.x86_64 3.4.3-1.30.amzn1 @amzn-main
python34-pip.noarch 6.1.1-1.21.amzn1 @amzn-main
python34-setuptools.noarch 12.2-1.30.amzn1 @amzn-main
python34-test.x86_64 3.4.3-1.30.amzn1 @amzn-main
python34-tools.x86_64 3.4.3-1.30.amzn1 @amzn-main
python34-virtualenv.noarch 12.0.7-1.12.amzn1 @amzn-updates
我怎樣才能得到這個工作?
'。/ myapp.py'是否在第一行定義了一個解釋器? –
如果你嘗試'python myapp.py'會怎麼樣? –
是的,'$ head -n 1 myapp.py #!/ home/me/python/myapp/venv/bin/python' – IgniFerroque