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

enum34 causing problems in pip #2603

Closed
jeffcjohnson opened this issue Dec 11, 2018 · 4 comments
Closed

enum34 causing problems in pip #2603

jeffcjohnson opened this issue Dec 11, 2018 · 4 comments

Comments

@jeffcjohnson
Copy link
Contributor

Hi,
When installing luigi in AWS Elastic Beanstalk with Python3.6, for some reason, on the second "eb deploy", pip ignores the restriction setup.py:

install_requires = [
'enum34>1.1.0;python_version<"3.4"',
]

and tries to install enum34.

I don't know if this is a limitation of pip, or a bug, or what it is. I've upgraded pip and setuptools to the latest version and get the same behavior.

It seems that this package is meant to solve these problems:
https://github.com/jstasiak/enum-compat

Would that be accepted in a PR?

@dlstadther
Copy link
Collaborator

dlstadther commented Dec 12, 2018

Hi @jeffcjohnson

I'm not overly keen on introducing that virtual package; its logic is the same as ours, just written differently.

I've not used AWS Elastic Beanstalk before, but are we sure that it is using Py 3.6 to run setup.py each time? Alternatively, do we know why it is running twice?

I think those are the more important questions to answer first.

Thanks for raising this case!

@jeffcjohnson
Copy link
Contributor Author

I should say that during the initial installation or build of the machine, it works fine, but during subsequent deployments from us running eb deploy manually, then it fails.

This is pip executable being used.

/opt/python/run/venv/bin/pip -V
pip 18.1 from /opt/python/run/venv/local/lib/python3.6/site-packages/pip (python 3.6)

Looking into that pip script gives the location of the python interpreter:

head -n1 /opt/python/run/venv/bin/pip
#!/opt/python/run/venv/bin/python3.6

Checking the version gives Python 3.6.5:

/opt/python/run/venv/bin/python3.6 --version
Python 3.6.5

This part installs enum34 but should not.

/opt/python/run/venv/bin/pip install luigi
Requirement already satisfied: luigi in /opt/python/run/venv/lib/python3.6/site-packages (2.8.0)
Collecting tornado<5,>=4.0 (from luigi)
Requirement already satisfied: python-daemon<2.2.0 in /opt/python/run/venv/lib/python3.6/site-packages (from luigi) (2.1.2)
Collecting enum34>1.1.0 (from luigi)
  Using cached https://files.pythonhosted.org/packages/af/42/cb9355df32c69b553e72a2e28daee25d1611d2c0d9c272aa1d34204205b2/enum34-1.1.6-py3-none-any.whl
Requirement already satisfied: lockfile>=0.10 in /opt/python/run/venv/lib/python3.6/site-packages (from python-daemon<2.2.0->luigi) (0.12.2)
Requirement already satisfied: setuptools in /opt/python/run/venv/lib/python3.6/site-packages (from python-daemon<2.2.0->luigi) (40.6.3)
Requirement already satisfied: docutils in /opt/python/run/venv/lib/python3.6/site-packages (from python-daemon<2.2.0->luigi) (0.14)
Installing collected packages: tornado, enum34
  Found existing installation: tornado 5.1.1
    Uninstalling tornado-5.1.1:

I will try to figure out why it is doing that. I know very little about Python packaging but I guess now is a good time to learn.

@jeffcjohnson
Copy link
Contributor Author

jeffcjohnson commented Dec 12, 2018

It looks like this issue confirms a suspicion that I had yesterday; that after the initial install, maybe as a wheel which I know little about, the version checking is lost.

Edit: that issue suggests using Environment Markers as a solution but luigi is already using them.

@jeffcjohnson
Copy link
Contributor Author

After reviewing the logs it looks like the initial install is installing enum34 for some reason and corrupts the python installation causing the eb deploy to fail.
I suspect this is a problem with the AWS scripts so will close this issue. I will re-open if it turns out to be a problem with luigi.

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

2 participants