[英]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. 我想用ipython运行python脚本,我需要在其中导入lmfit包。 At work I have a windows computer and everything worked there.
在工作中,我有一台Windows计算机,一切正常。 But my private computer has ubuntu 14.04 and I cannot even install the lmfit package.
但是我的私人计算机具有ubuntu 14.04,我什至无法安装lmfit软件包。 I have both python 3.4.3 and python 2.7.6 installed.
我同时安装了python 3.4.3和python 2.7.6。 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...
Exception:
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
pycompile=self.pycompile,
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
os.makedirs(destsubdir)
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. 这样就告诉我找不到lmfit。
I am really not an expert with those installing problems..I was very happy when I installed python and everything worked. 我真的不是那些安装问题的专家..当我安装python并且一切正常时,我感到非常高兴。 So please excuse me for this maybe stupid question.
所以请原谅我这个愚蠢的问题。
Thank you!! 谢谢!!
Because pip command has not right to write dirs in /usr/local/
因为pip命令无权在
/usr/local/
写入目录
So you should try sudo pip3 install lmfit
所以你应该尝试
sudo pip3 install lmfit
If your ipython is installed under py2, try sudo pip2 install lmfit
如果您的ipython安装在py2下,请尝试
sudo pip2 install lmfit
通过输入sudo pip3 install lmfit
,如果您的终端from pip import main [...] ImportError: cannot import name 'main'
,则可以通过使用sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
全新安装pip3来解决该问题sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
install sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall
如此处链接所述
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.