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 / pip3 installs an outdated version #14

Open
Shikogo opened this issue Nov 1, 2016 · 13 comments
Open

pip / pip3 installs an outdated version #14

Shikogo opened this issue Nov 1, 2016 · 13 comments

Comments

@Shikogo
Copy link
Contributor

Shikogo commented Nov 1, 2016

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?

@joshua-stone
Copy link
Owner

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

@eliskvitka
Copy link

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

@BytewaveMLP
Copy link

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.

@rautamiekka
Copy link

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

@BytewaveMLP
Copy link

BytewaveMLP commented May 26, 2017

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.

@joshua-stone
Copy link
Owner

@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

@BytewaveMLP
Copy link

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. ❤️

@joshua-stone
Copy link
Owner

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

@BytewaveMLP
Copy link

BytewaveMLP commented May 27, 2017

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
Copy link

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']
...

@dstufft
Copy link

dstufft commented May 29, 2017

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.

Shikogo added a commit to Shikogo/DerPyBooru that referenced this issue Jan 25, 2018
As pointed out in joshua-stone#14, the import in this is breaking pip because it tries to import requests before it's installed. As far as I can see, this import doesn't do anything, and it installed fine without it. So I request that this line gets removed so this package gets installed correctly through pip.
@sixeyedfox
Copy link

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.

@nullforce
Copy link

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

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

8 participants