zerovm / zpm

ZeroVM Package Manager
Apache License 2.0
6 stars 11 forks source link

Installing `zpm` with `python setup.py install` appears to be broken #147

Closed larsbutler closed 10 years ago

larsbutler commented 10 years ago

When I tried to install zpm into a virtualenv using setup.py, I get the following issues:

(zpm_test)lars@lars-saffron: ~/proj/zpm  (master) $ python setup.py install
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running install
running build
running build_py
copying zpmlib/commands.py -> build/lib.linux-x86_64-2.7/zpmlib
copying zpmlib/zpm.py -> build/lib.linux-x86_64-2.7/zpmlib
copying zpmlib/__init__.py -> build/lib.linux-x86_64-2.7/zpmlib
copying zpmlib/templates/index.html -> build/lib.linux-x86_64-2.7/zpmlib/templates
copying zpmlib/templates/style.css -> build/lib.linux-x86_64-2.7/zpmlib/templates
copying zpmlib/templates/zerocloud.js -> build/lib.linux-x86_64-2.7/zpmlib/templates
copying zpmlib/templates/zapp.yaml -> build/lib.linux-x86_64-2.7/zpmlib/templates
running build_scripts
copying and adjusting zpm -> build/scripts-2.7
running install_lib
creating /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib
creating /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/templates/zapp.yaml -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/templates/style.css -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/templates/zebra.js -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/templates/zerocloud.js -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/templates/index.html -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/templates
copying build/lib.linux-x86_64-2.7/zpmlib/commands.py -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib
copying build/lib.linux-x86_64-2.7/zpmlib/zpm.py -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib
copying build/lib.linux-x86_64-2.7/zpmlib/miniswift.py -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib
copying build/lib.linux-x86_64-2.7/zpmlib/__init__.py -> /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib
byte-compiling /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/commands.py to commands.pyc
byte-compiling /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/zpm.py to zpm.pyc
byte-compiling /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/miniswift.py to miniswift.pyc
byte-compiling /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpmlib/__init__.py to __init__.pyc
running install_scripts
copying build/scripts-2.7/zpm -> /home/lars/.virtualenvs/zpm_test/bin
changing mode of /home/lars/.virtualenvs/zpm_test/bin/zpm to 775
running install_egg_info
Writing /home/lars/.virtualenvs/zpm_test/lib/python2.7/site-packages/zpm-0.2-py2.7.egg-info
(zpm_test)lars@lars-saffron: ~/proj/zpm  (master) $ which zpm
/home/lars/.virtualenvs/zpm_test/bin/zpm
(zpm_test)lars@lars-saffron: ~/proj/zpm  (master) $ zpm --help
Traceback (most recent call last):
  File "/home/lars/.virtualenvs/zpm_test/bin/zpm", line 20, in <module>
    from zpmlib import commands
  File "/home/lars/.virtualenvs/zpm_test/local/lib/python2.7/site-packages/zpmlib/commands.py", line 22, in <module>
    from zpmlib import zpm
  File "/home/lars/.virtualenvs/zpm_test/local/lib/python2.7/site-packages/zpmlib/zpm.py", line 18, in <module>
    import jinja2
ImportError: No module named jinja2
mgeisler commented 10 years ago

It seems you did not install Jinja2 in your virtualenv?

larsbutler commented 10 years ago

No I didn't. I guess distutils doesn't automatically install dependencies? setuptools does.

mgeisler commented 10 years ago

Right, distutils has never done dependency management. That came with unpopular easy_install script from the setuptools package. That was the same package that suggested that people let their setup.py script bootstrap setuptools if it wasn't already installed — a drive-by-install of setuptools when you tried to install some other package.

The deal is that you use pip install if you want dependencies resolved and python setup.py install if you want to install a single package. Having pip available implies that setuptools is there too since pip depends on setuptools.

larsbutler commented 10 years ago

Okay, thanks for the clarification. I was under the false impression that dependencies should be resolved in this case.

mgeisler commented 10 years ago

No problem!