aclark4life / vanity

Get package download statistics from PyPI
GNU General Public License v2.0
66 stars 14 forks source link

installation of 'requests' is not automatic #58

Open veltzer opened 7 years ago

veltzer commented 7 years ago

I installed vanity in a newly created python virtualenv thus: $ pip install vanity (this is a python 3.5 virtualenv) but it did not work since 'requests' was not installed with it. I took a look in 'setup.py' and it does specify 'requests' as prereq.

Can this be? Must the package name also be in requirements.txt?

hugovk commented 7 years ago

The same is true with Python 2.7:

⌂86% [hugo:/tmp] % pip install vanity -v
Collecting vanity
  1 location(s) to search for versions of vanity:
  * https://pypi.python.org/simple/vanity/
  Getting page https://pypi.python.org/simple/vanity/
  Looking up "https://pypi.python.org/simple/vanity/" in the cache
  Current age based on date: 388
  Freshness lifetime from max-age: 600
  Freshness lifetime from request max-age: 600
  The response is "fresh", returning cached response
  600 > 388
  Analyzing links from page https://pypi.python.org/simple/vanity/
    Found link https://pypi.python.org/packages/0a/37/0a2396fa4918d96590614c7cc179273c139a8b53dc862187667e55d1d796/vanity-2.2.1.tar.gz#md5=e366df8ae2bcf0b47ac208f2357f63da (from https://pypi.python.org/simple/vanity/), version: 2.2.1
    Found link https://pypi.python.org/packages/15/3f/a9a85fd0fed53978471af596eed8236d792e7d402a905a7c60f7b824856b/vanity-2.2.0.tar.gz#md5=134ceb0a930f3502160c0938d75f05f0 (from https://pypi.python.org/simple/vanity/), version: 2.2.0
    Found link https://pypi.python.org/packages/16/81/3d05f9723cc602041c48b8185378f0741165019439872df12f05f37e909a/vanity-2.2.2.zip#md5=da19f2a0e9ac2e568c1a781e317a7827 (from https://pypi.python.org/simple/vanity/), version: 2.2.2
    Found link https://pypi.python.org/packages/1e/7d/89179dbedd3c9cc2d4234e8baa54e64aa7e08d0d2d02923269c370186827/vanity-1.2.2.zip#md5=b969856a25da9ea07c53ab95eb584f60 (from https://pypi.python.org/simple/vanity/), version: 1.2.2
    Found link https://pypi.python.org/packages/36/18/1e49119614601d5be608bcab9a49076ed26a0d8bd52ee2d3342baa52db40/vanity-2.1.0.zip#md5=ade992a97b1ba4bd1a1ff90414dde6a2 (from https://pypi.python.org/simple/vanity/), version: 2.1.0
    Found link https://pypi.python.org/packages/36/8d/9fd94ceb416d65e4cc9f178f6d664905ca32a198091b322cba7d51e3f238/vanity-2.0.5.zip#md5=b42d4bab1e2e451e3110de2cdd5275ce (from https://pypi.python.org/simple/vanity/), version: 2.0.5
    Found link https://pypi.python.org/packages/3d/24/8a36e991b9feb372a4c676c9d70613f009e18ad94e4284a96687694935ee/vanity-2.0.0.zip#md5=994876bc2e2a4720cc02a9181af83700 (from https://pypi.python.org/simple/vanity/), version: 2.0.0
    Found link https://pypi.python.org/packages/41/ed/8001ffba14f6f309483e1299ce2e63be7d736135a68b1a6e1817b2fbf299/vanity-1.2.3.zip#md5=fde582c87f0218d72e2fd34a9d5f1a37 (from https://pypi.python.org/simple/vanity/), version: 1.2.3
    Found link https://pypi.python.org/packages/60/1f/38fd96ca9e7d2cb8f7c15dea193c9495f42d721c24981d7b770622b00e41/vanity-1.2.0.tar.gz#md5=54d1ede5811ffdd8bcef663b412f0893 (from https://pypi.python.org/simple/vanity/), version: 1.2.0
    Found link https://pypi.python.org/packages/65/97/7950bcaa084b604933357917cec26bdddf84396bcb6881ce82aea86a56f4/vanity-2.0.3.zip#md5=f8e30ad53242245cf5a7f392a5b0a00e (from https://pypi.python.org/simple/vanity/), version: 2.0.3
    Found link https://pypi.python.org/packages/7c/2d/89774b6cafb06159151a882cc44cddbff0698dfaa94982f2abf795aacdb4/vanity-2.2.2.tar.gz#md5=9cbdad077e87dc4569683ddf56b44895 (from https://pypi.python.org/simple/vanity/), version: 2.2.2
    Found link https://pypi.python.org/packages/87/71/9ef9a3a08ce392828cf1f170fd13edf41df52836e287716922de34cd1722/vanity-1.2.4.zip#md5=c91890c2cb31b0984a93841aa2593878 (from https://pypi.python.org/simple/vanity/), version: 1.2.4
    Found link https://pypi.python.org/packages/9c/0d/5af6d38315aae887af42f62fc7c352539e0ca4d3df50ab6a4aa79368e8f7/vanity-1.0.zip#md5=5291eee60be62434e34b1a3387358bbf (from https://pypi.python.org/simple/vanity/), version: 1.0
    Found link https://pypi.python.org/packages/a1/6f/d942e197e007ede8a1255a3f38b104540dca3175d9779d9d039eecf4a510/vanity-2.0.4.zip#md5=b135769f881f014753925259a1457fef (from https://pypi.python.org/simple/vanity/), version: 2.0.4
    Found link https://pypi.python.org/packages/a7/16/800f81b82e005c8d798f8d1ad68da9afc297021ebb2f315d025375ce56dd/vanity-1.1.2.zip#md5=cd079c27f3189a4e013734ded3f65afe (from https://pypi.python.org/simple/vanity/), version: 1.1.2
    Found link https://pypi.python.org/packages/b5/b1/de0d78257a4b0f660967762a2bc5afe02b53d0e6dd3c1f0e448f8c0cf5a1/vanity-1.1.0.zip#md5=e9f22b7d8c46f1012f9ce028e63162c0 (from https://pypi.python.org/simple/vanity/), version: 1.1.0
    Found link https://pypi.python.org/packages/bf/22/f64ef2173b6027ffe2ef34b2947822c3c6f8afab584c0abbe117f4b87370/vanity-2.0.2.zip#md5=563fa782865f5da7c241ee622196f718 (from https://pypi.python.org/simple/vanity/), version: 2.0.2
    Found link https://pypi.python.org/packages/c5/29/fbb775f439fccc3d486d3070b40a0d2c27f48784935cd00a708062261436/vanity-1.2.5.zip#md5=d7575f80c903ed7ede243302a3661c9e (from https://pypi.python.org/simple/vanity/), version: 1.2.5
    Found link https://pypi.python.org/packages/ca/48/992d189745ad141e8ebbeda9f23d899eb1ac0be22dbe9b7b681fa4cb6724/vanity-1.2.1.tar.gz#md5=3d1a1c9edc9a95575d4d38167102bc11 (from https://pypi.python.org/simple/vanity/), version: 1.2.1
    Found link https://pypi.python.org/packages/d6/54/da50ca17451d096237aead78cd16ad4eadf11075f7827bc39a05c8df8930/vanity-2.2.0.zip#md5=75d0594b6b80757c60b3cfa512745e99 (from https://pypi.python.org/simple/vanity/), version: 2.2.0
    Found link https://pypi.python.org/packages/d8/e5/4e4b4c7ec550854bcec4ada686a8f9b8d81b61f57c32b09d02446b856626/vanity-2.0.1.zip#md5=6edb0a4a3e8177a116a3ce47c7a13c34 (from https://pypi.python.org/simple/vanity/), version: 2.0.1
    Found link https://pypi.python.org/packages/f3/0a/7894eeab81f689632fc1a1f42709f13e5f78a205ad243d13efc0c213afc0/vanity-2.2.1.zip#md5=4a583d050548c003e034cf4b5832d300 (from https://pypi.python.org/simple/vanity/), version: 2.2.1
    Found link https://pypi.python.org/packages/f3/6f/5bc6eed7cc09ea56f293833b1d5d1ff470acf8eac9eebb9a74edad53c000/vanity-1.1.1.zip#md5=e512cafec3cdf12b1415035337046eec (from https://pypi.python.org/simple/vanity/), version: 1.1.1
  Using version 2.2.2 (newest of versions: 1.0, 1.1.0, 1.1.1, 1.1.2, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.5, 2.1.0, 2.2.0, 2.2.1, 2.2.2)
  Using cached wheel link: file:///Users/hugo/Library/Caches/pip/wheels/a1/f8/12/9a8b31ae442093ea8f33a70898d862c8e8a9b0dccb5b975514/vanity-2.2.2-cp27-none-any.whl
Installing collected packages: vanity

  changing mode of /usr/local/bin/vanity to 755
Successfully installed vanity-2.2.2
Cleaning up...
⌂81% [hugo:/tmp] 2s % vanity vanity
Traceback (most recent call last):
  File "/usr/local/bin/vanity", line 7, in <module>
    from vanity import vanity
  File "/usr/local/lib/python2.7/site-packages/vanity.py", line 38, in <module>
    import requests
ImportError: No module named requests
hugovk commented 7 years ago

But python setup.py install installs it:

⌂81% [hugo:~/github/vanity] master 2s ± python setup.py install
running install
running bdist_egg
running egg_info
writing requirements to vanity.egg-info/requires.txt
writing vanity.egg-info/PKG-INFO
writing top-level names to vanity.egg-info/top_level.txt
writing dependency_links to vanity.egg-info/dependency_links.txt
writing entry points to vanity.egg-info/entry_points.txt
reading manifest file 'vanity.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.txt' under directory 'docs'
writing manifest file 'vanity.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.12-x86_64/egg
running install_lib
running build_py
creating build/bdist.macosx-10.12-x86_64/egg
copying build/lib/vanity.py -> build/bdist.macosx-10.12-x86_64/egg
byte-compiling build/bdist.macosx-10.12-x86_64/egg/vanity.py to vanity.pyc
creating build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/PKG-INFO -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/SOURCES.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/dependency_links.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/entry_points.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/requires.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/top_level.txt -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
copying vanity.egg-info/zip-safe -> build/bdist.macosx-10.12-x86_64/egg/EGG-INFO
creating 'dist/vanity-2.2.2-py2.7.egg' and adding 'build/bdist.macosx-10.12-x86_64/egg' to it
removing 'build/bdist.macosx-10.12-x86_64/egg' (and everything under it)
Processing vanity-2.2.2-py2.7.egg
Removing /usr/local/lib/python2.7/site-packages/vanity-2.2.2-py2.7.egg
Copying vanity-2.2.2-py2.7.egg to /usr/local/lib/python2.7/site-packages
vanity 2.2.2 is already the active version in easy-install.pth
Installing vanity script to /usr/local/bin

Installed /usr/local/lib/python2.7/site-packages/vanity-2.2.2-py2.7.egg
Processing dependencies for vanity==2.2.2
Searching for requests
Reading https://pypi.python.org/simple/requests/
Downloading https://pypi.python.org/packages/2c/b5/2b6e8ef8dd18203b6399e9f28c7d54f6de7b7549853fe36d575bd31e29a7/requests-2.18.1.tar.gz#md5=40f723ed01dddeaf990d0609d073f021
Best match: requests 2.18.1
Processing requests-2.18.1.tar.gz
Writing /var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/easy_install-c0OK81/requests-2.18.1/setup.cfg
Running requests-2.18.1/setup.py -q bdist_egg --dist-dir /var/folders/kt/j77sf4_n6fnbx6pg199rbx700000gn/T/easy_install-c0OK81/requests-2.18.1/egg-dist-tmp-nKMnPf
warning: no files found matching 'NOTICE'
creating /usr/local/lib/python2.7/site-packages/requests-2.18.1-py2.7.egg
Extracting requests-2.18.1-py2.7.egg to /usr/local/lib/python2.7/site-packages
Adding requests 2.18.1 to easy-install.pth file

Installed /usr/local/lib/python2.7/site-packages/requests-2.18.1-py2.7.egg
Searching for certifi==2017.4.17
Best match: certifi 2017.4.17
Processing certifi-2017.4.17-py2.7.egg
certifi 2017.4.17 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/site-packages/certifi-2017.4.17-py2.7.egg
Searching for urllib3==1.21.1
Best match: urllib3 1.21.1
Processing urllib3-1.21.1-py2.7.egg
urllib3 1.21.1 is already the active version in easy-install.pth

Using /usr/local/lib/python2.7/site-packages/urllib3-1.21.1-py2.7.egg
Searching for idna==2.5
Best match: idna 2.5
Adding idna 2.5 to easy-install.pth file

Using /usr/local/lib/python2.7/site-packages
Searching for chardet==3.0.4
Best match: chardet 3.0.4
Processing chardet-3.0.4-py2.7.egg
chardet 3.0.4 is already the active version in easy-install.pth
Installing chardetect script to /usr/local/bin

Using /usr/local/lib/python2.7/site-packages/chardet-3.0.4-py2.7.egg
Finished processing dependencies for vanity==2.2.2
vitorbaptista commented 6 years ago

I can confirm this also happens on Python 3.6