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 from GitHub owing to old setuptools on CentOS #227

Closed
verdurin opened this issue Jan 21, 2016 · 22 comments
Closed

Problem installing from GitHub owing to old setuptools on CentOS #227

verdurin opened this issue Jan 21, 2016 · 22 comments
Assignees
Milestone

Comments

@verdurin
Copy link
Contributor

I'm trying to install from GitHub, as usual. I did notice a recent commit stating that the Ansible requirement would remain at 1.9.x for now, but pip install ansible of course installed 2.0.0.2.

Inside the virtualenv, I ran python setup.py install and saw the following error:

(elasticluster)[centos@vanloo-admin src]$ python setup.py install
error in elasticluster setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
@riccardomurri
Copy link
Contributor

What branch are you installing from?

@verdurin
Copy link
Contributor Author

This is with master, which I believe is supposed to be the more stable branch with the way you're managing things now?

@riccardomurri
Copy link
Contributor

I cannot reproduce the issue; master installs fine in a freshly
created virtualenv on my machine::

$ git checkout master
Already on 'master'
Your branch is up-to-date with 'origin/master'.

$ git rev-parse --short HEAD
89958da

$ mkvirtualenv elasticluster-issue-227
Using real prefix '/usr'
New python executable in elasticluster-issue-227/bin/python2
Also creating executable in elasticluster-issue-227/bin/python
Installing setuptools, pip, wheel...done.

(elasticluster-issue-227)$ python setup.py install
/home/rmurri/.virtualenvs/elasticluster-issue-227/local/lib/python2.7/site-packages/setuptools/dist.py:285: UserWarning: Normalizing '1.2.1.rc1' to '1.2.1rc1'
  normalized_version,
running install
running bdist_egg
running egg_info
writing requirements to elasticluster.egg-info/requires.txt
writing elasticluster.egg-info/PKG-INFO
[...]
Using /home/rmurri/.virtualenvs/elasticluster-issue-227/lib/python2.7/site-packages
Finished processing dependencies for elasticluster==1.2.1rc1

(elasticluster-issue-227)$ which elasticluster
/home/rmurri/.virtualenvs/elasticluster-issue-227/bin/elasticluster

(elasticluster-issue-227)$ elasticluster --version
elasticluster version 1.2.1rc1

No problem is detected by the CI server, either: https://travis-ci.org/gc3-uzh-ch/elasticluster/jobs/103839621

Is it possible that your Git checkout is not up-to-date or that you
have local modifications?

@verdurin
Copy link
Contributor Author

Well, I would say that the procedure you've followed there is rather different than what's in the documentation.

@riccardomurri
Copy link
Contributor

Well, I would say that the procedure you've followed there is rather different than what's in the documentation.

How is it different? The docs tell you to:

  1. Create a virtualenv and activate it
  2. Check out the git repo
  3. Run python setup.py install

The only differences I can see is that I used mkvirtualenv instead of plain virtualenv + source .../activate and that I have the git repo already checked out so I just switched branch...

@verdurin
Copy link
Contributor Author

Just tried it again, on a CentOS 7.2 VM:

[centos@vanloo-admin src]$ mkdir venv-test
[centos@vanloo-admin src]$ cd venv-test
[centos@vanloo-admin venv-test]$ virtualenv elasticluster
New python executable in elasticluster/bin/python
Installing Setuptools..............................................................................................................................................................................................................................done.
Installing Pip.....................................................................................................................................................................................................................................................................................................................................done.
[centos@vanloo-admin venv-test]$ . elasticluster/bin/activate
(elasticluster)[centos@vanloo-admin venv-test]$ cd elasticluster
(elasticluster)[centos@vanloo-admin elasticluster]$ git clone git://github.com/gc3-uzh-ch/elasticluster.git src
Cloning into 'src'...
remote: Counting objects: 5591, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 5591 (delta 9), reused 0 (delta 0), pack-reused 5561
Receiving objects: 100% (5591/5591), 2.32 MiB | 229.00 KiB/s, done.
Resolving deltas: 100% (3250/3250), done.
(elasticluster)[centos@vanloo-admin elasticluster]$ cd src
(elasticluster)[centos@vanloo-admin src]$ python setup.py install
error in elasticluster setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

@riccardomurri
Copy link
Contributor

Anyway, just to be sure, here are the steps exactly as written in the
docs
. Same outcome, i.e., no error.

$ virtualenv elasticluster
New python executable in elasticluster/bin/python
Installing setuptools, pip, wheel...done.

$ . elasticluster/bin/activate

(elasticluster)$ pip install ansible
Collecting ansible
  Downloading ansible-2.0.0.2.tar.gz (1.5MB)
  [...]
Successfully installed MarkupSafe-0.23 PyYAML-3.11 ansible-2.0.0.2 ecdsa-0.13 jinja2-2.8 paramiko-1.16.0 pycrypto-2.6.1

(elasticluster)$ cd elasticluster

(elasticluster)$ git clone git://github.com/gc3-uzh-ch/elasticluster.git src
Cloning into 'src'...
remote: Counting objects: 5591, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 5591 (delta 9), reused 0 (delta 0), pack-reused 5561
Receiving objects: 100% (5591/5591), 2.32 MiB | 3.01 MiB/s, done.
Resolving deltas: 100% (3250/3250), done.
Checking connectivity... done.

(elasticluster)$ python setup.py install
/tmp/elasticluster/local/lib/python2.7/site-packages/setuptools/dist.py:285: UserWarning: Normalizing '1.2.1.rc1' to '1.2.1rc1'
  normalized_version,
running install
running bdist_egg
running egg_info
creating elasticluster.egg-info
writing requirements to elasticluster.egg-info/requires.txt
writing elasticluster.egg-info/PKG-INFO
[....]
Using /tmp/elasticluster/lib/python2.7/site-packages
Finished processing dependencies for elasticluster==1.2.1rc1

(elasticluster)$ which elasticluster
/tmp/elasticluster/bin/elasticluster

(elasticluster)$ elasticluster --version
elasticluster version 1.2.1rc1

@verdurin
Copy link
Contributor Author

Could be a version problem? Here's what I have:

python-virtualenv-1.10.1-2.el7.noarch

@verdurin
Copy link
Contributor Author

Okay, it's the specification of the ansible that's the problem.

If I change it to:

'ansible>=1.9.4, < 2.0.0.2',

for example, it works.

@riccardomurri
Copy link
Contributor

You mean ansible ~= 1.9.4 is the problem?

What version of Python's setuptools does CentOS 7 have installed?

@verdurin
Copy link
Contributor Author

Yes.

python-setuptools-0.9.8-4.el7.noarch

@verdurin
Copy link
Contributor Author

I've submitted a PR that should fix this. You may wish to fine-tune the version specification.

@riccardomurri
Copy link
Contributor

Does it work if you replace the version specification with the following?

ansible == 1.9.*

@riccardomurri riccardomurri self-assigned this Jan 21, 2016
@riccardomurri riccardomurri added this to the 1.2.1 milestone Jan 21, 2016
@verdurin
Copy link
Contributor Author

No - the error reappears.

@riccardomurri
Copy link
Contributor

So the issue is that setuptools is too old... the reference implementation for PEP 440 version specifiers was merged on August 27, 2014, whereas setuptools-0.9.8 was released in summer 2013.

@verdurin verdurin changed the title Problem installing from GitHub Problem installing from GitHub owing to old setuptools on CentOS Jan 21, 2016
@riccardomurri
Copy link
Contributor

So I guess I'll do the following:

  • merge your PR for the 1.2.1 release
  • try to bootstrap setuptools to a newer release (we need >=8.0 for version specifiers to work) for other branches; running with such an old setuptools might land us other unexpected problems as well...

Does this sound reasonable?

@verdurin
Copy link
Contributor Author

Yes, that makes sense.

@verdurin
Copy link
Contributor Author

Using

pip install --upgrade pip

inside the virtualenv works, so that could be added to the instructions, specifically for CentOS.

@riccardomurri
Copy link
Contributor

Can you please try installing branch hotfix/ensure-recent-setuptools with the vanilla instructions? (i.e., no pip install --upgrade trick)

Does it work?

@verdurin
Copy link
Contributor Author

Yes, that works.

It installs correctly and I can list my existing cluster.

@riccardomurri
Copy link
Contributor

Thanks, then I'll use that variant for the development branch

@riccardomurri
Copy link
Contributor

Fixed in commit 295c617 on the "master" branch, and in commits b2f782c..7d7e5e5 on the "develop" branch.

@riccardomurri riccardomurri modified the milestones: 1.3, 1.2.1 Sep 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants