#๐Ÿ”’ lzfse

46 messages ยท Page 1 of 1 (latest)

hardy burrowBOT
#

@echo sail

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

echo sail
vague terrace
#

I think you want Visual Studio. Disclaimer: I'm not a windows person.

echo sail
#

it doesnt did anything

vague terrace
#

Oh.

#

Can you post the full output of the command you ran to install lzfse and its output?

echo sail
#

can i somehow send you link

#

or file

vague terrace
#

!code
Can you copy/paste the text output? Between code fence marker lines?

hardy burrowBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

vague terrace
#

Could you try the command:

pip install --prefer-binary lzfse

to see if it behaves differently. There are some prebuilt binary installs of this package, your system might be covered. Or not.

#

What variety of Windows are you on?

echo sail
vague terrace
#

What version of Python? The prebuilt wheels seem to be for Python 3.10 (see https://pypi.org/project/lzfse/#files).
You could install 3.10 in addition to whatever Python you're using, and go:

py -3.10 -m pip install --prefer-binary lzfse

which tells the Python launcher (py) to use version 3.10.

echo sail
hardy burrowBOT
#

Hey @echo sail!

It looks like you are trying to paste code into this channel.

You seem to be using the wrong symbols to indicate where the code block should start. The correct symbols would be ```, not '''.

Here is an example of how it should look:
```
Hello, world!
```

This will result in the following:

Hello, world!```
You can **edit your original message** to correct your code block.
vague terrace
#

Yes, you will need to fetch Python 3.10 from the windows store first.

echo sail
#

so do i need to uniistall current version?

vague terrace
#

No, you can keep multiple versions around. Often useful.

#

Apparently if you set the PYLAUNCHER_ALLOW_INSTALL environment variable it might autoinstall it for you.

vague terrace
#

Oh, excellent!

Note that it will have installed the package in the 3.10 environment. You'll need to use that. You may be able to make it the default, unsure.

echo sail
vague terrace
#

Oh. I was hoping it would not need to build a wheel once you were using 3.10. That's what the --prefer-binary was meant to encourage.

vague terrace
#

If the build error is as before you will need to install a working C++ compiler.

#

FYI: this is what's available for lzfse: https://pypi.org/project/lzfse/#files
The .tar.gz is the source version, which is what it's trying to build from.
The .whl files are prebuilt binary distributions for various platforms (zip files which are simply unpacked into your Python, and do not require a C++ compiler).
I was hoping there would be one for whatever flavour of Windows you are running.

vague terrace
#

I Don't know your windows version, but pip is supposed to figure that out for you and do it automatically. You said 22H2 but I don't know what that means.

echo sail
#

im windows 10

vague terrace
#

This is entirely a guess.

vague terrace
#

The best way would be to make a virtual environment and install it into there. Safer than potentially mangling your primary Python install.

#

What do you need it for?

#

!venv

hardy burrowBOT
#
Virtual environments

Virtual environments are isolated Python environments, which make it easier to keep your system clean and manage dependencies. By default, when activated, only libraries and scripts installed in the virtual environment are accessible, preventing cross-project dependency conflicts, and allowing easy isolation of requirements.

To create a new virtual environment, you can use the standard library venv module: python3 -m venv .venv (replace python3 with python or py on Windows)

Then, to activate the new virtual environment:

Windows (PowerShell): .venv\Scripts\Activate.ps1
or (Command Prompt): .venv\Scripts\activate.bat
MacOS / Linux (Bash): source .venv/bin/activate

Packages can then be installed to the virtual environment using pip, as normal.

For more information, take a read of the documentation. If you run code through your editor, check its documentation on how to make it use your virtual environment. For example, see the VSCode or PyCharm docs.

Tools such as poetry and pipenv can manage the creation of virtual environments as well as project dependencies, making packaging and installing your project easier.

Note: When using PowerShell in Windows, you may need to change the execution policy first. This is only required once per user:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
vague terrace
#

So you'd:

  • make a venv per the above
  • activate it
  • cd into its site-packages directory
  • unpack the .whl file as a zip file

As an example, here (a Mac) I've got a venv made from Python 3.12 and the site-packages directory is located here: lib/python3.12/site-packages within the venv.

#

Really, it would be simpler and safer if you could make the C++ compiler work.

hardy burrowBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.