Windows中的Python包ImportError

时间:2013-10-07 19:07:05

标签: python windows importerror tabular

我在Windows上安装Python包时遇到了困难。在对本网站上的所有问题做出回应之后,我通过谷歌找到的其他问题都没有解决问题。

我最初遵循本指南: http://docs.python-guide.org/en/latest/starting/install/win/

我尝试重新安装Python,更新pip和其他安装包,使用python install表格手动安装,更新注册表,以及在干净的VM中安装新的Python副本。

提前感谢您的帮助!

这是pip的输出:

>  Running setup.py egg_info for package tabular
> 
>     Traceback (most recent call last):
> 
>       File "<string>", line 16, in <module>
> 
>       File "c:\users\jgerber\appdata\local\temp\pip_build_jgerber\tabular\setup.py",
> line 50, in <module>
> 
>         raise ImportError("distribute was not found and fallback to setuptools was not allowed")
> 
>     ImportError: distribute was not found and fallback to setuptools was not allowed
> 
>     Complete output from command python setup.py egg_info:
> 
>     Traceback (most recent call last):
> 
>   File "<string>", line 16, in <module>
> 
>   File
> "c:\users\jgerber\appdata\local\temp\pip_build_jgerber\tabular\setup.py",
> line 50, in <module>
> 
>     raise ImportError("distribute was not found and fallback to setuptools was not allowed")
> 
> ImportError: distribute was not found and fallback to setuptools was
> not allowed
> 
> ----------------------------------------
> 
> Cleaning up...
> 
>   Removing temporary dir
> c:\users\jgerber\appdata\local\temp\pip_build_jgerber... Command
> python setup.py egg_info failed with error code 1 in
> c:\users\jgerber\appdata\local\temp\pip_build_jgerber\tabular
> 
> Exception information: Traceback (most recent call last):   File
> "C:\Python27\lib\site-packages\pip\basecommand.py", line 134, in main
>     status = self.run(options, args)   File "C:\Python27\lib\site-packages\pip\commands\install.py", line 236, in
> run
>     requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)   File
> "C:\Python27\lib\site-packages\pip\req.py", line 1134, in
> prepare_files
>     req_to_install.run_egg_info()   File "C:\Python27\lib\site-packages\pip\req.py", line 259, in run_egg_info
>     command_desc='python setup.py egg_info')   File "C:\Python27\lib\site-packages\pip\util.py", line 670, in
> call_subprocess
>     % (command_desc, proc.returncode, cwd)) InstallationError: Command python setup.py egg_info failed with error code 1 in
> c:\users\jgerber\appdata\local\temp\pip_build_jgerber\tabular

2 个答案:

答案 0 :(得分:1)

pip无法找到分发

运行pip install distribute

或者如果没有设置pip的路径,请运行c:\python27\Scripts\pip.exe distribute


你也可以尝试easy_install distribute

c:\python27\Scripts\easy_install.exe distribute

答案 1 :(得分:0)

我在Windows上的表格中遇到了同样的问题。通过包括 http://python-distribute.org/distribute_setup.py 在与setup.py文件相同的文件夹中,安装时没有问题。