Tini Tini - 1 year ago 135
Python Question

Problems with installing python package lmfit under Ubuntu 14.04

I want to run a python script with ipython, where I need to import the lmfit package. At work I have a windows computer and everything worked there. But my private computer has ubuntu 14.04 and I cannot even install the lmfit package. I have both python 3.4.3 and python 2.7.6 installed. I tried with pip

pip3 install lmfit

and what I get is:

Downloading/unpacking lmfit
Downloading lmfit-0.9.5-py3-none-any.whl (102kB): 102kB downloaded
Requirement already satisfied (use --upgrade to upgrade): scipy in /usr/lib/python3/dist-packages (from lmfit)
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib/python3/dist-packages (from lmfit)
Installing collected packages: lmfit
Cleaning up...
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 206, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 193, in clobber
File "/usr/lib/python3.4/os.py", line 237, in makedirs
mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/lmfit'

Storing debug log for failure in /home/kristin/.pip/pip.log

I also tried

sudo apt-get install python-lmfit

With that it tells me that lmfit can not be found.

I am really not an expert with those installing problems..I was very happy when I installed python and everything worked. So please excuse me for this maybe stupid question.

Thank you!!

Answer Source

Because pip command has not right to write dirs in /usr/local/

So you should try sudo pip3 install lmfit

If your ipython is installed under py2, try sudo pip2 install lmfit

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download