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

Problem installing 2.3 as dependency from setup.py #51

Closed
robclewley opened this issue Apr 29, 2015 · 13 comments
Closed

Problem installing 2.3 as dependency from setup.py #51

robclewley opened this issue Apr 29, 2015 · 13 comments

Comments

@robclewley
Copy link

My colleague had this problem today, trying to install through pip. My package, that he's trying to install, and which depends on tinydb, has the setup.py requirement for tinydb>=2.2. Are we missing something silly here or is there a problem with the uploaded 2.3 version to pip? Thanks!

Searching for tinydb>=2.2
Reading https://pypi.python.org/simple/tinydb/
Best match: tinydb 2.3.0-b
Downloading https://pypi.python.org/packages/source/t/tinydb/tinydb-2.3.0-b.zip#md5=15f0720f29a7f673a4bec54cd5ec6350
Processing tinydb-2.3.0-b.zip
Writing /tmp/easy_install-udrz_6/tinydb-2.3.0/setup.cfg
Running tinydb-2.3.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-udrz_6/tinydb-2.3.0/egg-dist-tmp-HZLQA2
No eggs found in /tmp/easy_install-udrz_6/tinydb-2.3.0/egg-dist-tmp-HZLQA2 (setup script problem?)
error: Could not find required distribution tinydb>=2.2
@msiemens
Copy link
Owner

Very interesting. As far as I can see, this only occurs when using TinyDB as a dependency in setup.py, not when installing via pip. I'm not sure about the cause but I remember tinkering the files for v2.3.0 uploaded to PyPI to hotfix some oversights.

Anyways, I just published v2.3.1 which you should be able to depend on without problems (as long as you don't use ==2.3.0 which doesn't seem to work 😞).

Can you confirm that this is fixed?

@robclewley
Copy link
Author

Not for my friend, unfortunately:

Searching for tinydb>=2.3
Reading https://pypi.python.org/simple/tinydb/
Best match: tinydb 2.3.1
Downloading https://pypi.python.org/packages/source/t/tinydb/tinydb-2.3.1.zip#md5=ff22ef7166f471ec3e5077b43b76bf46
Processing tinydb-2.3.1.zip
Writing /tmp/easy_install-V5Hz1z/tinydb-2.3.1/setup.cfg
Running tinydb-2.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-V5Hz1z/tinydb-2.3.1/egg-dist-tmp-kfLvr6
No eggs found in /tmp/easy_install-V5Hz1z/tinydb-2.3.1/egg-dist-tmp-kfLvr6 (setup script problem?)
error: The 'tinydb>=2.3' distribution was not found and is required by fovea

Thanks for taking a look.

@robclewley robclewley changed the title Problem installing 2.3 from pip Problem installing 2.3 as dependency from setup.py May 1, 2015
@msiemens
Copy link
Owner

msiemens commented May 2, 2015

Okay, strange. Could you post the contents of the setup.py file?

@robclewley
Copy link
Author

https://github.com/robclewley/fovea/blob/master/setup.py

But my friend updated it to request >=2.3 instead, as you suggested, and it still didn't work. What exactly did you change to address the problem? Because your setup.py looked the same as before.

@msiemens
Copy link
Owner

msiemens commented May 4, 2015

Yeah, I suspected that the problem is with the PyPI package and thus uploaded a new version there, which solved it for a test case I had constructed. I'm currently trying to reconstruct what python setup.py install does and why exactly it fails.
First I thought it's because my setup.py tries to read the README.md from the current working directory and not relative to the setup.py file (as for example in the setup.py you linked). But changing that doesn't help (I've uploaded version 2.3.1.post1 for that purpose). Right now I'm absolutely clueless :(

@robclewley
Copy link
Author

That's unfortunate! Please follow up if you find out more or have a fix. I'll be happy to help test. Is it worth inquiring on the python mailing list? You have a valuable tool here and I want to depend on it :) I'm writing a blog post right now that utilizes it (well, indirectly for now, but it will get center stage at a later date), and it would be awesome if any interested readers can install my package from github and have them automatically get hold of the dependencies. But I can alert them to maybe needing to pip install by hand, which is OK.

@msiemens
Copy link
Owner

msiemens commented May 4, 2015

I went deeper down the rabbit hole and found two things:

  1. It seems like the cause is that the egg file created when running python setup.py bdist_egg on my package doesn't have a EGG-INFO/PKG-INFO file. I'll look into that later (it's getting late here).
  2. I wasn't able to reproduce this problem on my Fedora VM (my development machine runs on Windows 7). What operating system to you use?

@robclewley
Copy link
Author

Cool. I'm on OS X and I strongly suspect my colleague is too. I don't know what version he's running but I've been testing my code with 10.6.8. I could try testing a fresh install of my package on a windows machine this week.

@msiemens
Copy link
Owner

msiemens commented May 4, 2015

Okay, I think I got it now. The reason the PKG-INFO was missing because all packages uploaded to PyPI have a <package-name>.egg-info folder which in my case was TinyDB.egg-info whereas setuptools expected tinydb.egg-info. I suppose I had the capitalized version right from the start and later on changed the package name to lower case. I can only speculate why my setup.py never complained.

I've now uploaded version 2.3.1.post2 to PyPI which installed fine on my Windows machine. Can you confirm this?

@msiemens
Copy link
Owner

msiemens commented May 4, 2015

For the sake of completeness: my setup.py probably never complained because when it tried to write to tinydb.egg-info/ Windows redirected it to the existing TinyDB.egg-info/ because of the case insensitivity of paths. Thus my uploaded packages had the wrong *.egg-info directory which caused setuptools (used by easy_install and the setup.py) to stumble.

@eugene-eeo
Copy link
Contributor

@msiemens as an aside, slightly off topic but didn't the Python community deem using setuptools/distutils in a setup script as deprecated?

@msiemens
Copy link
Owner

msiemens commented May 5, 2015

@eugene-eeo As far as I know setuptools is still the standard, see for example http://stackoverflow.com/q/25337706/997063

@robclewley
Copy link
Author

Yes, it works now, thank you! And yes, setuptools is still the standard.

vitalk added a commit to vitalk/passpie that referenced this issue May 8, 2015
Unable to install package via setuptools, e.g. `python setup.py install`
because of bad tinydb distribution (as per msiemens/tinydb#51). Small
workaround for this issue.
msiemens added a commit that referenced this issue May 9, 2015
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

3 participants