darkdragn / lz4tools

LZ4Frame Bindings and tools for Python
90 stars 30 forks source link

C++ Compiler error #6

Open ScottShingler opened 9 years ago

ScottShingler commented 9 years ago

I'm trying to install lz4 using pip install lz4, but I get the following error:

Collecting lz4                                                                                                 
  Using cached lz4-0.7.0.tar.gz                                                                                
Installing collected packages: lz4                                                                             
  Running setup.py install for lz4                                                                             
    Complete output from command C:\tools\python2\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\xxxxx~1.xxx\\appdata\\local\\temp\\pip-build-tzepnf\\lz4\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\xxxxx~1.xxx\appdata\local\temp\pip-p767ra-record\install-record.txt --single-version-externally-managed --compile:                 
    running install                                                                                            
    running build                                                                                              
    running build_ext                                                                                          
    building 'lz4' extension                                                                                   
    creating build                                                                                             
    creating build\temp.win-amd64-2.7                                                                          
    creating build\temp.win-amd64-2.7\Release                                                                  
    creating build\temp.win-amd64-2.7\Release\src                                                              
    C:\Users\xxxxx.xxxxxxxx\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -IC:\tools\python2\include -IC:\tools\python2\PC /Tcsrc/lz4.c /Fobuild\temp.win-amd64-2.7\Release\src/lz4.obj -std=c99 -O3 -Wall -W -Wundef -DLZ4_VERSION="r119"                      
    cl : Command line error D8004 : '/W' requires an argument                                                  
    error: command 'C:\\Users\\xxxxx.xxxxxxxx\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

I'm running Python 2.7 and have the matching Microsoft Visual C++ Compiler for Python 2.7 installed. Is this lz4 package not compatible with Python 2.7?

darkdragn commented 8 years ago

No, this doesn't have anything to do with python. The C++ compiler for your system doesn't like the /W switch without an argument, which setup.py is throwing in. I'll just throw in a test for microsoft and have it change the compiler flags for your system. Not sure if I'll get to it tonight though, and I'm terribly sorry I didn't get to this sooner.

V/R, Chris

darkdragn commented 8 years ago

That compiler string was mainly a holdover from another project. I just removed the blank -W switch, and left the others. I know you haven't even looked at this in a while, but if by some slight of fate, you get this message, please give it another try. Tomorrow, I'll kick up an old windows VM and give it a try as well.

--try 03b8525 --

V/R, Chris

rutsky commented 8 years ago

What is the status of this issue?

I think simple including -W only on non-Windows system should fix this issue.

brainsh commented 1 year ago

I'm trying to install lz4tools using pip3 install lz4tools in Windows, but I get the following error:

$ pip install lz4tools
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Collecting lz4tools
  Using cached lz4tools-1.3.1.2.tar.gz (61 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: lz4tools
  Building wheel for lz4tools (setup.py): started
  Building wheel for lz4tools (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  python setup.py bdist_wheel did not run successfully.
  exit code: 1

  [18 lines of output]
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\lz4file.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\lz4tar.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\__init__.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\__main__.py -> build\lib.win-amd64-3.9\lz4tools
  running build_ext
  building 'lz4f' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Python39\include -Ic:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcsrc/lz4.c /Fobuild\temp.win-amd64-3.9\Release\src/lz4.obj -std=c99 -O3 -Wall -W -Wundef -DVERSION="1.3.1.2" -DLZ4_VERSION="r124"
  command line error D8004: '/W' requires an argument
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for lz4tools
  Running setup.py clean for lz4tools
Failed to build lz4tools
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
Installing collected packages: lz4tools
  Running setup.py install for lz4tools: started
  Running setup.py install for lz4tools: finished with status 'error'
  error: subprocess-exited-with-error

  Running setup.py install for lz4tools did not run successfully.
  exit code: 1

  [18 lines of output]
  running install
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.9
  creating build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\lz4file.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\lz4tar.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\__init__.py -> build\lib.win-amd64-3.9\lz4tools
  copying lz4tools\__main__.py -> build\lib.win-amd64-3.9\lz4tools
  running build_ext
  building 'lz4f' extension
  creating build\temp.win-amd64-3.9
  creating build\temp.win-amd64-3.9\Release
  creating build\temp.win-amd64-3.9\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\Python39\include -Ic:\Python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.34.31933\include -IC:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\VS\include /Tcsrc/lz4.c /Fobuild\temp.win-amd64-3.9\Release\src/lz4.obj -std=c99 -O3 -Wall -W -Wundef -DVERSION="1.3.1.2" -DLZ4_VERSION="r124"
  command line error D8004: '/W' requires an argument
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.34.31933\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

Encountered error while trying to install package.

lz4tools

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)
WARNING: Ignoring invalid distribution -ip (c:\python39\lib\site-packages)

[notice] A new release of pip is available: 23.0 -> 23.0.1
[notice] To update, run: python.exe -m pip install --upgrade pip