Forever-Young / mrab-regex-hg

Automatically exported from code.google.com/p/mrab-regex-hg
0 stars 0 forks source link

Trouble installing on Windows. #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm on a Windows 7 (that's the bulk of the problem) 64-bit, attempting to 
install 'regex' via python32's pip.

From within the directory that contains my pip, I ran this command using the 
standard Windows cmd.exe:

`pip.exe install regex`

Here is the output and the trace back:'''

Downloading/unpacking regex
  Running setup.py egg_info for package regex

Installing collected packages: regex
  Running setup.py install for regex
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\Python32\Scripts\build\regex\setup.py", line 49, in <module>
        ext_modules=[Extension('_regex', [os.path.join(PKG_BASE, '_regex.c'), os.path.join(PKG_BASE, _regex_unicode.c')])],
      File "c:\Python32\lib\distutils\core.py", line 148, in setup
        dist.run_commands()
      File "c:\Python32\lib\distutils\dist.py", line 917, in run_commands
        self.run_command(cmd)
      File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
        cmd_obj.run()
      File "c:\Python32\lib\site-packages\setuptools\command\install.py", line 53, in run
        return _install.run(self)
      File "c:\Python32\lib\distutils\command\install.py", line 569, in run
        self.run_command('build')
      File "c:\Python32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
        cmd_obj.run()
      File "c:\Python32\lib\distutils\command\build.py", line 126, in run
        self.run_command(cmd_name)
      File "c:\Python32\lib\distutils\cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
        cmd_obj.run()
      File "c:\Python32\lib\site-packages\setuptools\command\build_ext.py", line 46, in run
        _build_ext.run(self)
      File "c:\Python32\lib\distutils\command\build_ext.py", line 314, in run
        force=self.force)
      File "c:\Python32\lib\distutils\ccompiler.py", line 1034, in new_compiler
        return klass(None, dry_run, force)
      File "c:\Python32\lib\distutils\cygwinccompiler.py", line 278, in __init__

        CygwinCCompiler.__init__ (self, verbose, dry_run, force)
      File "c:\Python32\lib\distutils\cygwinccompiler.py", line 122, in __init__

        if self.ld_version >= "2.10.90":
    TypeError: unorderable types: NoneType() >= str()
    Complete output from command c:\Python32\python3.2.exe -c "import setuptools;__file__='c:\\Python32\\Scripts\\build\\regex\\setup.py';exec(compile(open(__file__).read().replace('\r\n', \n'), __file__, 'exec'))" install --single-version-externally-managed --record c:\users\aj\appdata\local\temp\pip-1v5kle-ecord\install-record.txt:
    running install

running build

running build_py

running build_ext

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\Python32\Scripts\build\regex\setup.py", line 49, in <module>
    ext_modules=[Extension('_regex', [os.path.join(PKG_BASE, '_regex.c'), os.path.join(PKG_BASE, '_regex_unicode.c')])],
  File "c:\Python32\lib\distutils\core.py", line 148, in setup
    dist.run_commands()
  File "c:\Python32\lib\distutils\dist.py", line 917, in run_commands
    self.run_command(cmd)
  File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "c:\Python32\lib\site-packages\setuptools\command\install.py", line 53, in run
    return _install.run(self)
  File "c:\Python32\lib\distutils\command\install.py", line 569, in run
    self.run_command('build')
  File "c:\Python32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "c:\Python32\lib\distutils\command\build.py", line 126, in run
    self.run_command(cmd_name)
  File "c:\Python32\lib\distutils\cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "c:\Python32\lib\distutils\dist.py", line 936, in run_command
    cmd_obj.run()
  File "c:\Python32\lib\site-packages\setuptools\command\build_ext.py", line 46, in run
    _build_ext.run(self)
  File "c:\Python32\lib\distutils\command\build_ext.py", line 314, in run
    force=self.force)
  File "c:\Python32\lib\distutils\ccompiler.py", line 1034, in new_compiler
    return klass(None, dry_run, force)
  File "c:\Python32\lib\distutils\cygwinccompiler.py", line 278, in __init__
    CygwinCCompiler.__init__ (self, verbose, dry_run, force)
  File "c:\Python32\lib\distutils\cygwinccompiler.py", line 122, in __init__
    if self.ld_version >= "2.10.90":
TypeError: unorderable types: NoneType() >= str()
'''
Then, of course it tells me where the error log is kept, so on and so forth.

Unfortunately, I am limited to using windows at work (which, as mentioned 
earlier, is probably the bulk of the problem); however, surely there is a way 
to get around this.
—Anthony

Original issue reported on code.google.com by anth...@ebookarchitects.com on 16 Jan 2013 at 5:21

GoogleCodeExporter commented 9 years ago
distutils is checking the version of "ld", but it can't find "ld", so the 
version is None. It's not possible to compare a string against None.

Why can't it find "ld"? I don't know. What is "ld"? I don't know, I'm not 
familiar with it. I'm using Microsoft Visual C++ Express on Windows XP Pro 
(32-bit).

You could try asking on python-list@python.org.

Sorry I can't help.

Original comment by re...@mrabarnett.plus.com on 16 Jan 2013 at 6:02

GoogleCodeExporter commented 9 years ago
This definitely appears to be an issue with my C compiler or lack thereof, 
rather. It is mentioned on the PyPi site that .pyd files are included with the 
source. The question that remains is: How do I use them, and what are they for? 
From the research that I've done, they appear to be the python version of .dll 
files. Still, what are they good for? How could one use them without a working 
C/C++ compiler on windows?

Original comment by anth...@ebookarchitects.com on 16 Jan 2013 at 10:15

GoogleCodeExporter commented 9 years ago
The regex package consists of some Python files and a .pyd file which contains 
the regex 'engine' (the stdlib's re module also consists of some Python files 
and a regex engine written in C, but in that instance it's built-in).

You can either build the .pyd file yourself (the source code is provided) or 
use the supplied one, but the supplied one is built for 32-bit Python on 
Windows. If you're not using 32-bit Python (CPython, to be exact) or Windows, 
then you'll have to build it yourself; the installer should do that for you, if 
you have a C compiler.

Original comment by re...@mrabarnett.plus.com on 17 Jan 2013 at 12:49

GoogleCodeExporter commented 9 years ago
Installers for Python 2.5 to 3.3, 32 and 64 bit, are available at 
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#regex>

Original comment by cjgoh...@gmail.com on 21 Jan 2013 at 4:46

GoogleCodeExporter commented 9 years ago
Thanks for all of the prompt feedback! The binary package at 
<http://www.lfd.uci.edu/~gohlke/pythonlibs/#regex> worked quite well.

Original comment by anth...@ebookarchitects.com on 22 Jan 2013 at 7:12

GoogleCodeExporter commented 9 years ago
Now that pip supports installing from wheel files, and PyPI supports publishing 
them for Mac OS X and Windows, perhaps it would be possible to start publishing 
wheels for regex?

Original comment by ncoghlan on 13 May 2014 at 3:08

GoogleCodeExporter commented 9 years ago
Would it be possible to include also .pyd file for 64-bit system and include it 
in such way, that the package can be installed using pip without it trying to 
compile from source? It seems that Wheel is for this so I'd like to second the 
previous comment by Nick Coghlan.

Original comment by Dre...@gmail.com on 25 Aug 2014 at 5:40

GoogleCodeExporter commented 9 years ago
I was thinking that I could just drop the binary files for Windows (.pyd) and 
point those who wanted them to Christoph Gohlke builds:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#regex

Original comment by re...@mrabarnett.plus.com on 25 Aug 2014 at 6:07

GoogleCodeExporter commented 9 years ago
Problem with those builds is that they are installed as Windows programs rather 
than Python packages managable by pip. Even though an installed package is 
present in pip list, when one tries to uninstall it, it just removes the .egg 
file. I don't like the idea of Python package management leaking to Windows 
installed programs list just because of one .pyd file. If only I could install 
it manually in pip aware way.

Original comment by Dre...@gmail.com on 25 Aug 2014 at 6:26

GoogleCodeExporter commented 9 years ago
Use `wheel` (http://wheel.readthedocs.org) to convert egg or wininst files to 
wheels and then pip install the whl file.

Original comment by cjgoh...@gmail.com on 25 Aug 2014 at 6:41

GoogleCodeExporter commented 9 years ago
It seems that wheel files are now included on PyPI. However I have a problem 
with installation. Basically, pip says the used wheel file is not supported on 
my platform, because of tags: the wheel file has ("py34", "none", "win_amd64"), 
but among my supported tags is just ("cp34", "none", "win_amd64").

Original comment by Dre...@gmail.com on 17 Sep 2014 at 10:15

GoogleCodeExporter commented 9 years ago
Maybe this is rather an issue of pip, so I also left a comment there. 
https://github.com/pypa/pip/issues/1870

Original comment by Dre...@gmail.com on 17 Sep 2014 at 10:47

GoogleCodeExporter commented 9 years ago
The wheels are tagged wrongly - they should use "cpXX" as the tag, not "pyXX". 
This is because the distribution contains a C extension, which is specific to 
the CPython interpreter (it won't work on Jython, for example) and so the tag 
should reflect that. Renaming the wheels uploaded to PyPI should work, but how 
did you create them? No correct tool should create wheels tagged like this.

If your setup.py used setuptools, you could do python setup.py bdist_wheel. 
Alternatively, from the source directory "pip wheel ." will create the wheels 
for you. They will have the correct name that way.

Also, the sdist on PyPI seems wrong, as it unpacks the files into the current 
directory, not into a subdirectory, as is usual. Was that created using 
setup.py sdist? It appears not, as setup.py sdist only picks up one of the 
Python2 or Python3 directories. Probably because of the line

   PKG_BASE = 'Python%i' % MAJOR

in setup.py. That is potentially fragile - it might be better to use a 
MANIFEST.in file to include both the Python2 and the Python3 directories.

Original comment by p.f.mo...@gmail.com on 17 Sep 2014 at 12:02

GoogleCodeExporter commented 9 years ago
I've fixed the tags in regex 2014.09.18.

Original comment by re...@mrabarnett.plus.com on 18 Sep 2014 at 12:14