Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
487 views
in Technique[技术] by (71.8m points)

pycharm - Python - Can't Install Packages: TypeError: unorderable types: NoneType() >= str()

System: Win7 64, Python 3.4, Pycharm 3.0.2, MinGW

Whenever I try to install a package, in Pycharm or via command line, I get this:

running install
running build
running build_py
running build_ext
Traceback (most recent call last):
  File "C:UsersMyAccountDownloadsscandir-masterscandir-mastersetup.py", line 48, in <module> 'Programming Language :: Python :: Implementation :: CPython',
  File "C:Python34libdistutilscore.py", line 148, in setup dist.run_commands()
  File "C:Python34libdistutilsdist.py", line 955, in run_commands self.run_command(cmd)
  File "C:Python34libdistutilsdist.py", line 974, in run_command cmd_obj.run()
  File "C:Python34libdistutilscommandinstall.py", line 554, in run self.run_command('build')
  File "C:Python34libdistutilscmd.py", line 313, in run_command self.distribution.run_command(command)
  File "C:Python34libdistutilsdist.py", line 974, in run_command cmd_obj.run()
  File "C:Python34libdistutilscommanduild.py", line 126, in run self.run_command(cmd_name)
  File "C:Python34libdistutilscmd.py", line 313, in run_command self.distribution.run_command(command)
  File "C:Python34libdistutilsdist.py", line 974, in run_command cmd_obj.run()
  File "C:Python34libdistutilscommanduild_ext.py", line 317, in run force=self.force)
  File "C:Python34libdistutilsccompiler.py", line 1031, in new_compiler return klass(None, dry_run, force)
  File "C:Python34libdistutilscygwinccompiler.py", line 282, in __init__ CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  File "C:Python34libdistutilscygwinccompiler.py", line 126, in __init__ if self.ld_version >= "2.10.90":
TypeError: unorderable types: NoneType() >= str()

Earlier today I was getting the "Unable to find vcvarsall.bat" error, but solved that with this thread.

I believe this problem was rooted in me uninstalling Visual Studio Express a few weeks back as I wasn't using it. Is there a way to get around this error without installing VSE again?

Thanks!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I solved this problem by conda install mingw in my virtual environment and then placing

[build]
compiler=msvc

in Libdistutilsdistutils.cfg


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...