Python - unable to 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 through the command line, I get the following:

running install running build running build_py running build_ext Traceback (most recent call last): File "C:\Users\MyAccount\Downloads\scandir-master\scandir-master\setup.py", line 48, in <module> 'Programming Language :: Python :: Implementation :: CPython', File "C:\Python34\lib\distutils\core.py", line 148, in setup dist.run_commands() File "C:\Python34\lib\distutils\dist.py", line 955, in run_commands self.run_command(cmd) File "C:\Python34\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "C:\Python34\lib\distutils\command\install.py", line 554, in run self.run_command('build') File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "C:\Python34\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "C:\Python34\lib\distutils\command\build.py", line 126, in run self.run_command(cmd_name) File "C:\Python34\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "C:\Python34\lib\distutils\dist.py", line 974, in run_command cmd_obj.run() File "C:\Python34\lib\distutils\command\build_ext.py", line 317, in run force=self.force) File "C:\Python34\lib\distutils\ccompiler.py", line 1031, in new_compiler return klass(None, dry_run, force) File "C:\Python34\lib\distutils\cygwinccompiler.py", line 282, in __init__ CygwinCCompiler.__init__ (self, verbose, dry_run, force) File "C:\Python34\lib\distutils\cygwinccompiler.py", line 126, in __init__ if self.ld_version >= "2.10.90": TypeError: unorderable types: NoneType() >= str() 

Earlier today I received the error "Could not find vcvarsall.bat", but decided that this thread .

I believe this problem was rooted in me by uninstalling Visual Studio Express a few weeks ago since I did not use it. Is there a way around this error without installing VSE again?

Thanks!

+6
source share
6 answers

Someone recommended that I try to compile helloworld.cpp using mingw. This failed!

The instructions that I used, I needed to install only mingw32-gcc-g ++. This did not work for me. Using the MinGW installation manager, I added:

  • MinGW Toolkit Developer
  • mingw32 base
  • Msys base
  • mingw32-gcc-g ++ (already installed previously)

So the correct instructions are:

  • Download the mingw-get-setup.exe installer from here: http://sourceforge.net/projects/mingw/files/Installer/
  • Run it
  • Install the above packages.
  • Add c: \ mingw \ bin \ to the path environment variable
  • Go to c: \ python34 \ Lib \ distutils \ and create the distutils.cfg file
  • Open distutils.cfg and insert two lines

    [build]

    compiler = mingw32

I think the compiler = mingw32 refers to the mingw32.exe executable. This file did not exist by default for me! I had to make a copy of mingw32-C ++. Exe and rename it to mingw32.exe.

I hope this helps someone else!

+2
source

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

 [build] compiler=msvc 

in lib \ distutils \ distutils.cfg

+2
source

Adding zolointo to the answer, installing cython worked fine after following your instructions. I install Kivy with Python 3.4.1 on Windows 7. Kiwi requires Cython. After loading Cython and running the installation scripts, I received the following error:

Compilation error Cython Problem ": cannot find vcvarsall.bat"

Investigating that the error led me to the MinGW installation path. If the MinGW installer overloads you with additional packages, doc, lic, bin and dll for installation. I installed the ones you mentioned above.

if you run:

python setup.py build_ext --inplace --compiler = mingw32 '

You will get a list of errors ending in:

TypeError: unorderable types: NoneType ()> = str ()

To fix this, I followed the zolointo instructions by adding MinGW to the PATH and creating the distutils.cfg file. At this point, you can run setup.py for Cython and everything will work!

+1
source

In Windows 7 with Python 3.42, I could solve this problem with what I found in this thread: Go to the Python34\Lib folder by typing dist-info in the search field in the upper right corner of the folder view and deleting all found folders. This already worked twice for me after I was unable to install anything else via pip without receiving the error message about which this thread is going.

+1
source

Install the compiler in msvc (Visual Studio)

It has been tested on Windows 10 x64, Python 3.5.1.

Decision:

Install the compiler in msvc (Visual Studio).

Create "distutils.cfg" in the folder "C: \ Python35-32 \ Lib \ distutils" with the following information

 [build] compiler=msvc [build_ext] compiler=msvc 

Link: https://wiki.python.org/moin/WindowsCompilers

+1
source

This error message is in Python, see this: http://bugs.python.org/issue2698

0
source

Source: https://habr.com/ru/post/972044/


All Articles