Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pip instal pylzma" not working #77

Open
TheDarkTiger opened this issue Nov 27, 2022 · 1 comment
Open

"pip instal pylzma" not working #77

TheDarkTiger opened this issue Nov 27, 2022 · 1 comment

Comments

@TheDarkTiger
Copy link

Greetings,

Despite being on windows, I can't / don't want to install the Visual Studio 2003 compiler.
I finally found someone whom have compiled the wheel files that I could install using
pip install pylzma-0.5.0-XXX.whl
Wheels can be downloaded here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pylzma

But that's really painful and not automatize-able.
I get it that you prefer to install the library using source code by default, and that's great.
But could you too give a wheel option, at least for the latest version of python?

I mean, I now hesitate to use this package in my projects, because it won't be easy for the users to install this lib if pip throws an error each time they try to install it.

If I missed something, please, do tell me.
Thank you for your work on this library.

@tr1ppyb0y
Copy link

Hey, @TheDarkTiger the wheel file is not there.

I am also facing the same issue, this is how I solved it.
FYI @fancycode

When it did this, pip install pylzma, I get this error,
image

Same error occurs when I am running these commands in python shell, from distutils import msvccompiler or from distutils.msvccompiler import MSVCCompiler

Although, when I tried to import the MSVCCompiler in python shell with this command, from distutils._msvccompiler import MSVCCompiler it imported just fine. Please see the screenshot below.

image

Initially I thought it's just file naming issue, but this is how I solved it, it's just a workaround, and I am also getting deprecation warnings, when I am running pip show pylzma

DEPRECATION: Loading egg at f:\fcc-gpt-scratch\cuda\lib\site-packages\pylzma-0.5.0.post17.dev0-py3.13-win-amd64.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation. Discussion can be found at https://github.com/pypa/pip/issues/12330

Steps 1 -
Change from distutils.msvccompiler import MSVCCompiler to from distutils._msvccompiler import MSVCCompiler

from distutils.msvccompiler import MSVCCompiler

Step 2 -
Reformat the string version in _normalize_version method, in file Lib\site-packages\setuptools\dist.py :370 from version to version = version[:-6] second hyphen is causing regex to return None. In Version(version).
https://github.com/pypa/setuptools/blob/e5f16a2a990ff18cdef27a22b742f97444867186/setuptools/dist.py#L370

Step 3 -
Then I created two files, _msvccompiler.py and msvccompiler.py
in this folder, https://github.com/pypa/setuptools/tree/main/setuptools/_distutils

And it worked.

Please tell me if there is another way to achieve this, or if I can be of any help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants