2015-05-08 35 views
3

我在Windows上運行2.7。直到昨天,當我嘗試使用multiprocessing庫來運行一些作業,出現一堆內存錯誤,並且所有內容都崩潰時,我一直沒有問題。Python壞了,AttributeError:'模塊'對象沒有屬性'python_version'

這是當我嘗試運行pip會發生什麼:

Traceback (most recent call last): 
    File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_ma 
    "__main__", fname, loader, pkg_name) 
    File "C:\Python27\lib\runpy.py", line 72, in _run_code 
    exec code in run_globals 
    File "C:\Python27\Scripts\pip.exe\__main__.py", line 5, in <mod 
    File "C:\Python27\lib\site-packages\pip\__init__.py", line 13, 
    from pip.utils import get_installed_distributions, get_prog 
    File "C:\Python27\lib\site-packages\pip\utils\__init__.py", lin 
e> 
    from pip._vendor import pkg_resources, six 
    File "C:\Python27\lib\site-packages\pip\_vendor\__init__.py", l 
_module 
    __import__(name) 
    File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources\_ 
ne 1316, in <module> 
    class MarkerEvaluation(object): 
    File "C:\Python27\lib\site-packages\pip\_vendor\pkg_resources\_ 
ne 1320, in MarkerEvaluation 
    'python_full_version': platform.python_version, 
AttributeError: 'module' object has no attribute 'python_version' 

我得到同樣的事情,當我嘗試import pandas從Python外殼。奇怪的是,當替代進口熊貓我嘗試運行import pandas as pd,我得到這個錯誤:

In [3]: import pandas as pd 
cannot import name hashtable 
------------------------------------------ 
ImportError 
<ipython-input-3-af55e7023913> in <module> 
----> 1 import pandas as pd 

C:\Python27\lib\site-packages\pandas\__ini 
     5 
     6 try: 
----> 7  from . import hashtable, tslib 
     8 except Exception: # pragma: no co 
     9  import sys 

ImportError: cannot import name hashtable 

任何想法,我怎麼能解決這個問題,而不完全重新安裝Python和我所有的圖書館?

回答

-1

您可以在您的python文件夾中找到platform.pyc,並將其取消。好的,你會看到它的工作(因爲它將有一個新的platform.pyc正確)。

相關問題