benjaminaschultz / shakespeare

Identify relevant scientific papers with simple machine learning techniques
MIT License
8 stars 3 forks source link

Local install #1

Closed csadorf closed 10 years ago

csadorf commented 10 years ago

I just wanted to install the latest version and the first thing I noticed is, that the setup.py does not support the --user option anymore. I guess this is related to using the setuptools instead of the distutils module.

A systemwide install did not produce any errors.

csadorf commented 10 years ago
python --version
Python 2.7.4
benjaminaschultz commented 10 years ago

A local install works fine for me; everything ends up in ~/.local. What platform are you on and what version of the setuptools library are you using? What happens when you use the user flag? It seems very unlikely any version of the setuptools module wouldn't support a user installation.

benjib0t@benjib0t-t440p ⮀ ~/software/git/shakespeare ⮀  master ⮀ python --version
Python 2.7.5+
>>> import setuptools
>>> setuptools.__version__
'0.6'
benjib0t@benjib0t-t440p ⮀ ~/software/git/shakespeare ⮀  master ⮀ python setup.py install --user
running install
running bdist_egg
running egg_info
writing shakespeare.egg-info/PKG-INFO
writing top-level names to shakespeare.egg-info/top_level.txt
writing dependency_links to shakespeare.egg-info/dependency_links.txt
reading manifest file 'shakespeare.egg-info/SOURCES.txt'
writing manifest file 'shakespeare.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/shakespeare
creating build/bdist.linux-x86_64/egg/shakespeare/content_sources
copying build/lib.linux-x86_64-2.7/shakespeare/content_sources/rss.py -> build/bdist.linux-x86_64/egg/shakespeare/content_sources
copying build/lib.linux-x86_64-2.7/shakespeare/content_sources/bibtex.py -> build/bdist.linux-x86_64/egg/shakespeare/content_sources
copying build/lib.linux-x86_64-2.7/shakespeare/content_sources/arxiv.py -> build/bdist.linux-x86_64/egg/shakespeare/content_sources
copying build/lib.linux-x86_64-2.7/shakespeare/content_sources/__init__.py -> build/bdist.linux-x86_64/egg/shakespeare/content_sources
creating build/bdist.linux-x86_64/egg/shakespeare/data
copying build/lib.linux-x86_64-2.7/shakespeare/data/prepositions.dat -> build/bdist.linux-x86_64/egg/shakespeare/data
copying build/lib.linux-x86_64-2.7/shakespeare/__init__.py -> build/bdist.linux-x86_64/egg/shakespeare
byte-compiling build/bdist.linux-x86_64/egg/shakespeare/content_sources/rss.py to rss.pyc
byte-compiling build/bdist.linux-x86_64/egg/shakespeare/content_sources/bibtex.py to bibtex.pyc
byte-compiling build/bdist.linux-x86_64/egg/shakespeare/content_sources/arxiv.py to arxiv.pyc
byte-compiling build/bdist.linux-x86_64/egg/shakespeare/content_sources/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/shakespeare/__init__.py to __init__.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts
running install_scripts
running build_scripts
creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts
copying build/scripts-2.7/shakespeare -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts
changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/shakespeare to 755
copying shakespeare.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying shakespeare.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying shakespeare.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying shakespeare.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/shakespeare-0.1-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing shakespeare-0.1-py2.7.egg
removing '/home/benjib0t/.local/lib/python2.7/site-packages/shakespeare-0.1-py2.7.egg' (and everything under it)
creating /home/benjib0t/.local/lib/python2.7/site-packages/shakespeare-0.1-py2.7.egg
Extracting shakespeare-0.1-py2.7.egg to /home/benjib0t/.local/lib/python2.7/site-packages
shakespeare 0.1 is already the active version in easy-install.pth
Installing shakespeare script to /home/benjib0t/.local/bin

Installed /home/benjib0t/.local/lib/python2.7/site-packages/shakespeare-0.1-py2.7.egg
Processing dependencies for shakespeare==0.1
Finished processing dependencies for shakespeare==0.1
csadorf commented 10 years ago

This is what I get when I try a local install:

$ python setup.py --user install
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: option --user not recognized

Maybe the default version shipped with the ubuntu distribution is funny? It does not have an attribute version, only __version__.

>>> import setuptools
>>> setuptools.version
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'version'
>>> setuptools.__version__
'0.6'
>>> 
benjaminaschultz commented 10 years ago

Yeah, there's nothing weird about the module not having an attribute version. I had the order of the arguments in the readme incorrect. You need to do

python setup.py install --user

not

python setup.py --user install

I have corrected this in the readme

csadorf commented 10 years ago

Oh, I remember that I made the same mistake before. Thank you!