How to install lmfit without root?

528 views
Skip to first unread message

Li Zhang

unread,
May 31, 2016, 11:21:04 PM5/31/16
to lmfit-py
Hello everyone,

I try to install lmfit-0.9.3 on a CentOS6.4 server, I met some problems which I can't solve it. However I don't have root authority, the administrator think that it should be installed in my own directory.

Way 1: I downloaded lmfit-py-0.9.3 from https://github.com/lmfit/lmfit-py/releases/tag/0.9.3:
$ tar -zxvf lmfit-py-0.9.3.tar.gz,
$./configure --prefix=/home/....
###ERROR    bash: ./configure: No such file or directory

$ tar -zxvf lmfit-0.9.3.tar.gz,
$ cd lmfit-0.9.3
$ python setup.py build
$ python setup.py install
####error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

    [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-2899.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

    /usr/local/lib/python2.7/dist-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

  https://pythonhosted.org/setuptools/easy_install.html

Please make the appropriate changes for your system and try again.
####

I tried to change the setup.py file, however I didn't find the directory term.

Way 3: 
$pip install lmfit --don't work
$easy_install -U lmfit --don't work

Could you tell me the answer if you know?

With Best Regards

Li Zhang

Matt Newville

unread,
Jun 1, 2016, 7:09:52 AM6/1/16
to lmfit-py
Hi Li,

On Tue, May 31, 2016 at 10:21 PM, Li Zhang <lizhang...@gmail.com> wrote:

Hello everyone,

I try to install lmfit-0.9.3 on a CentOS6.4 server, I met some problems which I can't solve it. However I don't have root authority, the administrator think that it should be installed in my own directory.

Way 1: I downloaded lmfit-py-0.9.3 from https://github.com/lmfit/lmfit-py/releases/tag/0.9.3:
$ tar -zxvf lmfit-py-0.9.3.tar.gz,
$./configure --prefix=/home/....
###ERROR    bash: ./configure: No such file or directory

That's not how (most) Python packages install.
 
$ tar -zxvf lmfit-0.9.3.tar.gz,
$ cd lmfit-0.9.3
$ python setup.py build
$ python setup.py install
####error: can't create or remove files in install directory

Since you're using Python2.7, I believe that doing
  python setup
.py install --user

should work to install to $HOME/.local/lib/python2.7/site-packages/lmfit-0.9.3.     Try
    python setup.py install --help

for more info on installation options.

--Matt

Li Zhang

unread,
Jun 1, 2016, 10:55:01 PM6/1/16
to lmfit-py, newv...@cars.uchicago.edu
Hi Matt,

Thank you very much for the usefull suggestion. I have installed it as your suggestion, but there are two SyntaxError for parameter.py and asteval.py.
when lmfit is imported, the error :
---> 21 from lmfit import minimize,Parameters,Parameter,report_fit
ImportError: No module named lmfit

What's the problem?

The installation information is as following:
######
$python setup.py build
$python setup.py install --user
running install
running bdist_egg
running egg_info
writing requirements to lmfit.egg-info/requires.txt
writing lmfit.egg-info/PKG-INFO
writing top-level names to lmfit.egg-info/top_level.txt
writing dependency_links to lmfit.egg-info/dependency_links.txt
reading manifest file 'lmfit.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.txt'
warning: no previously-included files found matching '*.pyc'
warning: no previously-included files found matching 'core.*'
warning: no previously-included files found matching '*~'
warning: no previously-included files found matching '*.pdf'
warning: no files found matching '*.dat' under directory 'tests'
warning: no previously-included files matching '*' found under directory 'doc/_build'
warning: no previously-included files matching '*.pdf' found under directory 'doc'
writing manifest file 'lmfit.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/lmfit
copying build/lib/lmfit/_differentialevolution.py -> build/bdist.linux-x86_64/egg/lmfit
creating build/bdist.linux-x86_64/egg/lmfit/uncertainties
copying build/lib/lmfit/uncertainties/__init__.py -> build/bdist.linux-x86_64/egg/lmfit/uncertainties
copying build/lib/lmfit/uncertainties/umath.py -> build/bdist.linux-x86_64/egg/lmfit/uncertainties
creating build/bdist.linux-x86_64/egg/lmfit/ui
copying build/lib/lmfit/ui/ipy_fitter.py -> build/bdist.linux-x86_64/egg/lmfit/ui
copying build/lib/lmfit/ui/__init__.py -> build/bdist.linux-x86_64/egg/lmfit/ui
copying build/lib/lmfit/ui/basefitter.py -> build/bdist.linux-x86_64/egg/lmfit/ui
copying build/lib/lmfit/printfuncs.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/astutils.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/minimizer.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/model.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/lineshapes.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/_version.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/parameter.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/asteval.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/ordereddict.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/models.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/confidence.py -> build/bdist.linux-x86_64/egg/lmfit
copying build/lib/lmfit/__init__.py -> build/bdist.linux-x86_64/egg/lmfit
byte-compiling build/bdist.linux-x86_64/egg/lmfit/_differentialevolution.py to _differentialevolution.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/uncertainties/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/uncertainties/umath.py to umath.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/ui/ipy_fitter.py to ipy_fitter.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/ui/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/ui/basefitter.py to basefitter.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/printfuncs.py to printfuncs.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/astutils.py to astutils.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/minimizer.py to minimizer.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/model.py to model.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/lineshapes.py to lineshapes.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/_version.py to _version.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/parameter.py to parameter.pyc
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/lmfit/parameter.py', 101, 29, '                          for key in sym_unique}\n'))

byte-compiling build/bdist.linux-x86_64/egg/lmfit/asteval.py to asteval.pyc
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/lmfit/asteval.py', 89, 49, '        py_symtable = {sym: __builtins__[sym] for sym in FROM_PY\n'))

byte-compiling build/bdist.linux-x86_64/egg/lmfit/ordereddict.py to ordereddict.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/models.py to models.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/confidence.py to confidence.pyc
byte-compiling build/bdist.linux-x86_64/egg/lmfit/__init__.py to __init__.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying lmfit.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying lmfit.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying lmfit.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying lmfit.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying lmfit.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/lmfit-0.9.3-py2.6.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing lmfit-0.9.3-py2.6.egg
removing '/home/zhangli/.local/lib/python2.6/site-packages/lmfit-0.9.3-py2.6.egg' (and everything under it)
creating /home/zhangli/.local/lib/python2.6/site-packages/lmfit-0.9.3-py2.6.egg
Extracting lmfit-0.9.3-py2.6.egg to /home/zhangli/.local/lib/python2.6/site-packages
SyntaxError: ('invalid syntax', ('/home/zhangli/.local/lib/python2.6/site-packages/lmfit-0.9.3-py2.6.egg/lmfit/parameter.py', 101, 29, '                          for key in sym_unique}\n'))

SyntaxError: ('invalid syntax', ('/home/zhangli/.local/lib/python2.6/site-packages/lmfit-0.9.3-py2.6.egg/lmfit/asteval.py', 89, 49, '        py_symtable = {sym: __builtins__[sym] for sym in FROM_PY\n'))

lmfit 0.9.3 is already the active version in easy-install.pth

Installed /home/zhangli/.local/lib/python2.6/site-packages/lmfit-0.9.3-py2.6.egg
Processing dependencies for lmfit==0.9.3
Searching for scipy==0.7.2
Best match: scipy 0.7.2
Adding scipy 0.7.2 to easy-install.pth file

Using /usr/lib64/python2.6/site-packages
Searching for numpy==1.4.1
Best match: numpy 1.4.1
Adding numpy 1.4.1 to easy-install.pth file

Using /usr/lib64/python2.6/site-packages
Finished processing dependencies for lmfit==0.9.3


Li :)


在 2016年6月1日星期三 UTC+8下午7:09:52,Matt Newville写道:

Matt Newville

unread,
Jun 2, 2016, 12:46:49 AM6/2/16
to lmfit-py
Hi Li,


Oh, but this time you're using Python 2.6, which lmfit 0.9.3 doesn't support.  Your previous output showed Python 2.7, which is supported.


--Matt

Reply all
Reply to author
Forward
0 new messages