p53/systeminfo

No build or installation instructions

Closed this issue · 5 comments

When I do the obvious

python setup.py build
sudo python setup.py install

I get the following errors

byte-compiling /usr/lib/python3.5/site-packages/systeminfo/template/propertytemplateall.py to propertytemplateall.cpython-35.pyc
byte-compiling /usr/lib/python3.5/site-packages/systeminfo/template/template.py to template.cpython-35.pyc
  File "/usr/lib/python3.5/site-packages/systeminfo/template/template.py", line 85
    print template.render(template_values)
                 ^
SyntaxError: invalid syntax

and

byte-compiling /usr/lib/python3.5/site-packages/systeminfo/proc/base.py to base.cpython-35.pyc
  File "/usr/lib/python3.5/site-packages/systeminfo/proc/base.py", line 202
    print 'You forgot to supply cache name!'
                                           ^
SyntaxError: Missing parentheses in call to 'print'

Since there are no installation instructions, I don't know if these are problems with the code or with the installation.

p53 commented

hi,

as i can see you are trying to install it with python3
It doesn't work with python3, just python2.7<, i can mention it in README, i was already considering python3, but there is dependency on dmidecode python module which doesn't have stable version for python3 yet.

you can download stable release and also installers for debian/redhat here:

https://github.com/p53/systeminfo/releases

Thanks for replying.

I'm still running into problems, even if I use python2. Using a freshgit
clone, I get the following output. See especially the highlighted lines
below:

$ sudo python2 setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/systeminfo
copying systeminfo/init.py -> build/lib/systeminfo
creating build/lib/systeminfo/io
copying systeminfo/io/file.py -> build/lib/systeminfo/io
copying systeminfo/io/init.py -> build/lib/systeminfo/io
creating build/lib/systeminfo/misc
copying systeminfo/misc/config.py -> build/lib/systeminfo/misc
copying systeminfo/misc/config-prod.py -> build/lib/systeminfo/misc
copying systeminfo/misc/init.py -> build/lib/systeminfo/misc
creating build/lib/systeminfo/proc
copying systeminfo/proc/cpu.py -> build/lib/systeminfo/proc
copying systeminfo/proc/tape.py -> build/lib/systeminfo/proc
copying systeminfo/proc/fcms.py -> build/lib/systeminfo/proc
copying systeminfo/proc/eth.py -> build/lib/systeminfo/proc
copying systeminfo/proc/memory.py -> build/lib/systeminfo/proc
copying systeminfo/proc/disk.py -> build/lib/systeminfo/proc
copying systeminfo/proc/base.py -> build/lib/systeminfo/proc
copying systeminfo/proc/pci.py -> build/lib/systeminfo/proc
copying systeminfo/proc/init.py -> build/lib/systeminfo/proc
copying systeminfo/proc/system.py -> build/lib/systeminfo/proc
creating build/lib/systeminfo/template
copying systeminfo/template/tabletemplate.py ->
build/lib/systeminfo/template
copying systeminfo/template/propertytemplateall.py ->
build/lib/systeminfo/template
copying systeminfo/template/template.py -> build/lib/systeminfo/template
copying systeminfo/template/init.py -> build/lib/systeminfo/template
error: package directory 'systeminfo/view' does not exist
$ systeminfo $ mkdir systeminfo/view
$ systeminfo $ sudo python2 setup.py install
running install
running build
running build_py
package init file 'systeminfo/view/init.py' not found (or not a
regular file)
*
*package init file 'systeminfo/view/init.py' not found (or not a
regular file)

running install_lib
copying build/lib/systeminfo/misc/config.py ->
/usr/lib/python2.7/site-packages/systeminfo/misc
copying build/lib/systeminfo/misc/config-prod.py ->
/usr/lib/python2.7/site-packages/systeminfo/misc
copying build/lib/systeminfo/misc/init.py ->
/usr/lib/python2.7/site-packages/systeminfo/misc
copying build/lib/systeminfo/template/tabletemplate.py ->
/usr/lib/python2.7/site-packages/systeminfo/template
copying build/lib/systeminfo/template/propertytemplateall.py ->
/usr/lib/python2.7/site-packages/systeminfo/template
copying build/lib/systeminfo/template/template.py ->
/usr/lib/python2.7/site-packages/systeminfo/template
copying build/lib/systeminfo/template/init.py ->
/usr/lib/python2.7/site-packages/systeminfo/template
copying build/lib/systeminfo/io/file.py ->
/usr/lib/python2.7/site-packages/systeminfo/io
copying build/lib/systeminfo/io/init.py ->
/usr/lib/python2.7/site-packages/systeminfo/io
copying build/lib/systeminfo/proc/cpu.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/tape.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/fcms.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/eth.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/memory.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/disk.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/base.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/pci.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/init.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/proc/system.py ->
/usr/lib/python2.7/site-packages/systeminfo/proc
copying build/lib/systeminfo/init.py ->
/usr/lib/python2.7/site-packages/systeminfo
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/misc/config.py to config.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/misc/config-prod.py to
config-prod.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/misc/init.py to
init.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/template/tabletemplate.py
to tabletemplate.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/template/propertytemplateall.py
to propertytemplateall.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/template/template.py to
template.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/template/init.py to
init.pyc
byte-compiling /usr/lib/python2.7/site-packages/systeminfo/io/file.py
to file.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/io/init.py to init.pyc
byte-compiling /usr/lib/python2.7/site-packages/systeminfo/proc/cpu.py
to cpu.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/tape.py to tape.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/fcms.py to fcms.pyc
byte-compiling /usr/lib/python2.7/site-packages/systeminfo/proc/eth.py
to eth.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/memory.py to memory.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/disk.py to disk.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/base.py to base.pyc
byte-compiling /usr/lib/python2.7/site-packages/systeminfo/proc/pci.py
to pci.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/init.py to
init.pyc
byte-compiling
/usr/lib/python2.7/site-packages/systeminfo/proc/system.py to system.pyc
byte-compiling /usr/lib/python2.7/site-packages/systeminfo/init.py
to init.pyc
running install_egg_info
Removing /usr/lib/python2.7/site-packages/systeminfo-1.5-py2.7.egg-info
Writing /usr/lib/python2.7/site-packages/systeminfo-1.5-py2.7.egg-info
(I don't see that a file called systeminfo (or something similar) is
copied to a system directory accessible to all users, but that could be
because the build/install failed.) Of course when I try to run
systeminfo it fails
$ sudo python2 ./systeminfo.py -g cpu
Traceback (most recent call last):
File "./systeminfo.py", line 163, in
main()
File "./systeminfo.py", line 160, in main
getattr(asset, action)(options)
File "/usr/local/src/systeminfo/systeminfo/proc/base.py", line 117,
in summary
self.createCache()
File "/usr/local/src/systeminfo/systeminfo/proc/base.py", line 182,
in createCache
cache_file_obj = open(cache_file, 'w+')
IOError: [Errno 2] No such file or directory: './cache/cpu.cache'
vivaldi systeminfo $ mkdir cache
vivaldi systeminfo $ sudo python2 ./systeminfo.py -g cpu
Traceback (most recent call last):
File "./systeminfo.py", line 163, in
main()
File "./systeminfo.py", line 160, in main
getattr(asset, action)(options)
File "/usr/local/src/systeminfo/systeminfo/proc/base.py", line 118,
in summary
self.view(options)
File "/usr/local/src/systeminfo/systeminfo/proc/base.py", line 170,
in view
templ_object.render(templ_path, templ_name, cached_path)
File "/usr/local/src/systeminfo/systeminfo/template/template.py",
line 77, in render
template = JINJA_ENVIRONMENT.get_template(templ_name)
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
812, in get_template
return self._load_template(name, self.make_globals(globals))
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line
786, in _load_template
template = self.loader.load(self, name, globals)
File "/usr/lib/python2.7/site-packages/jinja2/loaders.py", line 474,
in load
raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: cputplshort.j2

I'm not running Debian or Fedora, so those packages are not directly
usable by me. I'm running Arch Linux 4.4.5-1. It is possible for me to
convert a .deb file to something usable like a tar file, but it's an
extra step.

I'd like to suggest that for source installs, you make sure that

  1. Either there are complete build and install instructions, or an
    automated build and install script. Assume someone who is unfamiliar
    with the norms of your development environment.

  2. There are appropriate checks to ensure that all prerequisites, be
    they directories, files, executables, versions, etc., are in place.
    The goal is for any user to be able to type:

    $ sudo <build-and-install>
    $ systeminfo
    

    and for everything to just work.

I'd also like to suggest that invoking systeminfo without any command
line argument produce useful output instead of a help message.

--- Vladimir

Vladimir G. Ivanovic
(e) vladimir@acm.org mailto:vladimir@acm.org
(m) +1 650 450 4101
(MeetMe) https://doodle.com/vgivanovic

On 2016-03-11 05:07, p53 wrote:

hi,

as i can see you are trying to install it with python3
It doesn't work with python3, i can mention it in README, i was
already considering python3, but there is dependency on dmidecode
python module which doesn't have stable version for python3 yet.

you can download stable release and also installers for debian/redhat
here:

https://github.com/p53/systeminfo/releases


Reply to this email directly or view it on GitHub
#2 (comment).

p53 commented

yes, i must admit, that i am doing setup in packages not in setup.py, i am creating there cache dirs and so on, i will check it and think about good solution for both source install and package creation. Hmm that useful output without args isn't bad idea

p53 commented

i wrote instructions for installation, it would work with current master, they are not applicable to previous releases. I didn't write some installation script into my source because supporting different Linux distros would be too complex, so hopefully it would help you, i also implemented that default action without arguments

Thank you. I'll try to install again. If you don't hear from me, everything
went relatively smoothly.

-Vladimir

Vladimir G. Ivanovic
(e) vladimir@acm.org
(m) +1 650 450 4101
On Mar 12, 2016 11:53 AM, "p53" notifications@github.com wrote:

i wrote instructions for installation, it would work with current master,
they are not applicable to previous releases. I didn't write some
installation script into my source because supporting different Linux
distros would be too complex, so hopefully it would help you, i also
implemented that default action without arguments


Reply to this email directly or view it on GitHub
#2 (comment).