DerPyBooru icon indicating copy to clipboard operation
DerPyBooru copied to clipboard

pip / pip3 installs an outdated version

Open Shikogo opened this issue 8 years ago • 13 comments

Hi, maybe this is just me being ignorant about how things work, but no matter what I try, pip always installs version 0.6 for me, which doesn't work anymore with the changes to the API. I've reproduced this on multiple machines running different distros.

Anyone else experiencing this? Somebody know how to fix it?

Shikogo avatar Nov 01 '16 23:11 Shikogo

Thanks for bringing this to my attention. I'm not sure why PyPi is giving you an outdated version, but in the meantime you can install the package through Github directly:

pip install https://github.com/joshua-stone/DerPyBooru/zipball/master

joshua-stone avatar Nov 02 '16 17:11 joshua-stone

Pip installs outdated version because download_url in setup.py is incorrect.

eliskvitka avatar Nov 08 '16 11:11 eliskvitka

Bump. This is still an issue.

@braunly is correct, setup.py downloads an old version because the version number is hard-coded into download_url and wasn't changed following the update.

BytewaveMLP avatar Feb 06 '17 15:02 BytewaveMLP

Time to do something then ! This is exactly why derpibooru-dl fails.

rautamiekka avatar May 26 '17 20:05 rautamiekka

I published my own patched version here which can be used as a substitute if installed as a zipball. I haven't published it to PyPi as I'm not sure of the "legal" implications of such.

The project maintainer @joshua-stone appears to be inactive, so no PyPi update any time soon.

BytewaveMLP avatar May 26 '17 21:05 BytewaveMLP

@braunly @rautamiekka @BytewaveMLP I've been trying to fix the issue, but packaging has been difficult. There are multiple instances of version information across different files to keep track of, pip isn't providing meaningful error output, and PyPI doesn't seem to be clear about whether the PKG-INFO file I upload is even doing anything. After using Rust/Cargo, I'm finding that Python's tooling could definitely use an improvement in developer friendliness.

As mentioned before, installing from Github directly seems to at least work while I look into fixing the PyPI package:

pip install https://github.com/joshua-stone/DerPyBooru/zipball/master

joshua-stone avatar May 26 '17 22:05 joshua-stone

Oh huh, you're alive? That's good to know, at least.

Hopefully you can get things worked out. Would be nice to be able to use the official PyPi package at some point. ❤️

BytewaveMLP avatar May 26 '17 22:05 BytewaveMLP

Yeah I'm alive, although I admittedly haven't been keeping up with development.

I think I've finally fixed the problem. Please check by running this:

pip --no-cache-dir install derpybooru

joshua-stone avatar May 26 '17 23:05 joshua-stone

Collecting derpybooru
  Downloading DerPyBooru-0.7.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Bytewave\AppData\Local\Temp\pip-build-_toyc8wl\derpybooru\setup.py", line 6, in <module>
        import derpibooru
      File "C:\Users\Bytewave\AppData\Local\Temp\pip-build-_toyc8wl\derpybooru\derpibooru\__init__.py", line 27, in <module>
        from .search import Search
      File "C:\Users\Bytewave\AppData\Local\Temp\pip-build-_toyc8wl\derpybooru\derpibooru\search.py", line 29, in <module>
        from .request import get_images, url
      File "C:\Users\Bytewave\AppData\Local\Temp\pip-build-_toyc8wl\derpybooru\derpibooru\request.py", line 27, in <module>
        from requests import get, codes
    ModuleNotFoundError: No module named 'requests'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Bytewave\AppData\Local\Temp\pip-build-_toyc8wl\derpybooru\

After installing requests manually, however:

Collecting derpybooru
  Downloading DerPyBooru-0.7.3.tar.gz
Requirement already satisfied: requests in c:\python36\lib\site-packages (from derpybooru)
Installing collected packages: derpybooru
  Running setup.py install for derpybooru ... done
Successfully installed derpybooru-0.7.3

BytewaveMLP avatar May 27 '17 00:05 BytewaveMLP

And just to prove it's the correct version:

>>> import derpibooru
>>> for image in derpibooru.Search():
...     print("#{} - score: {:>3} - {}".format(image.id, image.score, image.tags))
...
#1446857 - score:   2 - ['equestria girls', 'juniper montage', 'light', 'magic', 'mirror magic', 'safe', 'screencap', 'solo', 'spoiler:eqg specials']
#1446855 - score:   7 - ['alicorn', 'apple bloom', 'artist:baron engel', 'cute', 'duo', 'hug', 'monochrome', 'pony', 'princess luna', 'safe', 'simple background', 'sketch', 'smiling', 'traditional art', 'white background']
#1446854 - score:  13 - ['alicorn', 'artist:hikariviny', 'cloud', 'crown', 'female', 'flying', 'full moon', 'jewelry', 'looking back', 'mare', 'moon', 'pony', 'princess luna', 'regalia', 'safe', 'smiling', 'solo', 'stars']
#1446853 - score:  11 - ['aeroshell', 'alternate hairstyle', 'apron', 'artist:kryptchild', 'ask glitter shell', 'canon x oc', 'clothes', 'comic', 'crossdressing', 'cup cake', 'date', 'gay', 'glitter shell', 'headband', 'hoodie', 'male', 'oc', 'oc:aero', 'parent:derpy hooves', 'parent:oc:warden', 'safe', 'scarf', 'shipping', 'skirt', 'snails', 'sugarcube corner', 'tumblr', 'when aero met glitter']
...

BytewaveMLP avatar May 27 '17 02:05 BytewaveMLP

The problem is that we (pip) have to run setup.py to determine what your dependencies are, but because you're importing your module in your setup.py, you're failing to import requests... because we don't know you need that yet when we run your setup.py to determine what your deps are.

Basically, you can't import your module inside your setup.py.

dstufft avatar May 29 '17 05:05 dstufft

With the pip install https://github.com/joshua-stone/DerPyBooru/zipball/master I've installed the 0.7.2 version successfully, and then the library manager in PyCharm indicated that there is an update, and successfully updated to 0.7.3. Though it still cannot be installed just by running a pip command, which definitely needs to be fixed.

sixeyedfox avatar May 26 '18 10:05 sixeyedfox

Still having this issue, without pre-installing requests manually, so I fixed it in a fork.

nullforce avatar May 03 '19 05:05 nullforce