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

Comments

3 participants
@robclewley

robclewley commented Apr 29, 2015

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

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens Apr 30, 2015

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?

Owner

msiemens commented Apr 30, 2015

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

This comment has been minimized.

Show comment
Hide comment
@robclewley

robclewley Apr 30, 2015

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 commented Apr 30, 2015

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 from Problem installing 2.3 from pip to Problem installing 2.3 as dependency from setup.py May 1, 2015

@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 2, 2015

Owner

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

Owner

msiemens commented May 2, 2015

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

@robclewley

This comment has been minimized.

Show comment
Hide comment
@robclewley

robclewley May 2, 2015

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.

robclewley commented May 2, 2015

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

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 4, 2015

Owner

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 :(

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

This comment has been minimized.

Show comment
Hide comment
@robclewley

robclewley May 4, 2015

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.

robclewley commented May 4, 2015

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

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 4, 2015

Owner

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?
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

This comment has been minimized.

Show comment
Hide comment
@robclewley

robclewley May 4, 2015

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.

robclewley commented May 4, 2015

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

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 4, 2015

Owner

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?

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

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 4, 2015

Owner

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.

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

This comment has been minimized.

Show comment
Hide comment
@eugene-eeo

eugene-eeo May 4, 2015

Contributor

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

Contributor

eugene-eeo commented May 4, 2015

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

@msiemens

This comment has been minimized.

Show comment
Hide comment
@msiemens

msiemens May 5, 2015

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@robclewley

robclewley May 8, 2015

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

robclewley commented May 8, 2015

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

@robclewley robclewley closed this May 8, 2015

vitalk added a commit to vitalk/passpie that referenced this issue May 8, 2015

Use the latest tinydb distribution in requirements
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