dlenski / python-zxing

python wrapper for the ZXing barcode library
GNU Lesser General Public License v3.0
121 stars 36 forks source link

Can't install ZXing - FileNotFoundError "requirements.txt" #32

Closed Fellow-Bennse closed 3 months ago

Fellow-Bennse commented 4 months ago

Hello there

I am trying to install ZXing on Python 3.10.6 and it fails on a Sub-Process when trying to get requirements to build the wheel:

"FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'"

Not quite sure what the Problem is in this case, or what I can do to fix it. I have OpenJDK 21.0.2 installed via Brew

saiteja2420 commented 4 months ago

"FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'" I am also facing the same issue my python version is 3.10 and openjdk version "11.0.21" 2023-10-17 in my ubuntu 22.04

dlenski commented 4 months ago

I am trying to install ZXing on Python 3.10.6 and it fails on a Sub-Process when trying to get requirements to build the wheel:

Hmmm… exactly how are you attempting to install it? From local source, or what? More details please.

lowvoltage commented 4 months ago

Same issue here. Steps to reproduce:

wget https://files.pythonhosted.org/packages/4b/ad/8e74e1a027c90baf7ba17760a80afe0a7f7b63725035d1f152a75e801b62/zxing-1.0.2.tar.gz
tar -xvzf zxing-1.0.2.tar.gz
cd zxing-1.0.2
python setup.py bdist_wheel

The URL is the one from https://pypi.org/project/zxing/#files FWIW, the previous version sdist, zxing-1.0.1.tar.gz has the same problem

Fellow-Bennse commented 4 months ago

@dlenski well, as it's mentioned on pypi with: pip install zxing (due to my setup pip is the same as pip3)

But as lowvoltage mentioned it also fails through the other way

saiteja2420 commented 4 months ago

I am trying to install ZXing on Python 3.10.6 and it fails on a Sub-Process when trying to get requirements to build the wheel:

Hmmm… exactly how are you attempting to install it? From local source, or what? More details please.

I used pip3 install zxing . this command raised the above FileNotFoundError.

no2spc commented 3 months ago

I have the same problem using the automated install pip install zxing I could solve it, by manually download and extracting the version from GitHub, and install it manually: pip install python-zxing-1.0.2/

PushpakBhoge512 commented 3 months ago

yes the wheel has some issues I am using this command it is working fine

pip install 'zxing @ git+https://github.com/dlenski/python-zxing.git@v1.0.2#zxing'
stefan6419846 commented 3 months ago

I just stumbled upon this as well, which is even more annoying as the requirements.txt is empty anyway (although we probably get the same issue for the requirements_dev.txt file not required for PyPI users). Adding the requirements*.txt files to a MANIFEST.in file should solve this issue.

zeusin commented 3 months ago

Having same problem with 1.0.2 If someone need an easy way of getting a working version until this is fixed: pip3 install zxing==1.0.1

dlenski commented 3 months ago

Thank you @stefan6419846!

I just stumbled upon this as well, which is even more annoying as the requirements.txt is empty anyway (although we probably get the same issue for the requirements_dev.txt file not required for PyPI users). Adding the requirements*.txt files to a MANIFEST.in file should solve this issue.

I'm going to go with this small incremental fix, rather than your slightly more involved solution in #37.

I probably need to catch up in my knowledge of more modern Python packaging approaches and tools :sweat_smile:

dlenski commented 3 months ago

Closed in c707794 / v1.0.3. Should be possible to use pip3 install zxing again, and it will Just Work™.

stefan6419846 commented 3 months ago

I'm going to go with this small incremental fix, rather than your slightly more involved solution in https://github.com/dlenski/python-zxing/pull/37.

No worries, this is perfectly fine for me. I just wanted to check correct packaging as well. The build-based approach is the recommended way for generating distributions without having to care about the build backend itself.

dlenski commented 3 months ago

The build-based approach is the recommended way for generating distributions without having to care about the build backend itself.

This is where I avowedly need to do something like a decade's worth on catching up on the state-of-the-art of Python packaging.