1

我对 Python、Nitrous.IO 和 MongoDB 以及一般的命令行都很陌生,所以如果可能的话,我会很感激这里的一些指导。

我正在尝试在我的 Nitrous.IO 盒子上安装 pymongo,但似乎找不到方法 -本教程建议“导入 pymongo”,但这不起作用(见下文)。

我似乎找不到任何教程或帮助 - 谷歌搜索“使用 nitrous.io 安装 +pymongo”给了我 0 个结果。

action@thirdyearproject-148753:~(master*)$ import pymongo                                                                                                 
import: unable to open X server `' @ error/import.c/ImportImageCommand/366.   

action@thirdyearproject-148753:~(master*)$ pip install pymongo                                                                                            
Traceback (most recent call last):                                                                                                                        
File "/home/action/.parts/bin/pip", line 9, in <module>                                                                                                 
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()                                                                                            
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 356, in load_entry_point                           
return get_distribution(dist).load_entry_point(group, name)  
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2431, in load_entry_point                          
return ep.load()                                                                                                                                      
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2147, in load                                      
['__name__'])                                                                                                                                         
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <modul                   
from pip.util import get_installed_distributions, get_prog                                                                                            
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 15, in <module>                     
from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global                                                               
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 96, in <modu                   
build_prefix = _get_build_prefix() 
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 64, in _get_                   
path = os.path.join(tempfile.gettempdir(), 'pip_build_%s' %                                                                                           
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 269, in gettempdir                                                    
tempdir = _get_default_tempdir()                                                                                                                      
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 212, in _get_default_tempdir                                          
("No usable temporary directory found in %s" % dirlist))                                                                                              
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/action']                                                

action@thirdyearproject-148753:~(master*)$ easy_install pymongo                                                                                           
Traceback (most recent call last):                                                                                                                        
File "/home/action/.parts/bin/easy_install", line 5, in <module>                                                                                        
from pkg_resources import load_entry_point  
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2829, in <module>                                   
working_set = WorkingSet._build_master()                                                                                                               
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 451, in _build_master                               
return cls._build_from_requirements(__requires__)                                                                                                      
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 464, in _build_from_requirements                    
dists = ws.resolve(reqs, Environment())                                                                                                                
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 639, in resolve                                     
raise DistributionNotFound(req)                                                                                                                        
pkg_resources.DistributionNotFound: setuptools==2.2   

action@thirdyearproject-148753:~(master*)$ parts install pymongo                                                                                           
parts: ERROR: Package "pymongo" not found                                                                                                                  
Aborting!                                      

有谁知道我将如何安装这个?它开始成为一个真正的痛苦!

4

1 回答 1

1

您可以pip使用此建议安装它。完成此操作后,您将使用import pymongo代码文件顶部的 。

于 2014-10-17T00:05:05.720 回答