【发布时间】:2015-10-06 15:16:54
【问题描述】:
嗯,我的 python 运行良好。突然间,它给了我这个:
-bash: ipython: command not found
我确实玩过一些 bash 配置文件,但我是初学者,所以我真的不知道我做了什么。我真的需要帮助。
无论如何,现在我尝试这样做并得到了这个:
Eddy-Lopez-Torres-Computer:~ eddylopez-torres$ pip install ipython
-bash: pip: command not found
Eddy-Lopez-Torres-Computer:~ eddylopez-torres$ sudo python setup.py install
python: can't open file 'setup.py': [Errno 2] No such file or directory
Eddy-Lopez-Torres-Computer:~ eddylopez-torres$ sudo python setup.py install
python: can't open file 'setup.py': [Errno 2] No such file or directory
Eddy-Lopez-Torres-Computer:~ eddylopez-torres$ cd Downloads/
Eddy-Lopez-Torres-Computer:Downloads eddylopez-torres$ cd LabTools-0.2.2
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
/usr/bin/python -E -c pass
TEST PASSED: /Library/Python/2.7/site-packages/ appears to support .pth files
running bdist_egg
running egg_info
writing LabTools.egg-info/PKG-INFO
writing top-level names to LabTools.egg-info/top_level.txt
writing dependency_links to LabTools.egg-info/dependency_links.txt
reading manifest file 'LabTools.egg-info/SOURCES.txt'
writing manifest file 'LabTools.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.10-intel/egg
running install_lib
running build_py
creating build/bdist.macosx-10.10-intel/egg
error: could not create 'build/bdist.macosx-10.10-intel/egg': Permission denied
我试着关注这个帖子:
有一次您尝试在 sudo 下运行 python setup.py 并且现在有一个属于 root 的 dist 目录。 清除构建目录中现有的 dist 子目录并重新运行:
sudo rm -rf ./dist
ARCHFLAGS='-arch x86_64' python setup.py install
如果您在最后的安装步骤中遇到权限错误,您可能需要在 sudo 下运行安装步骤:
sudo bash
export ARCHFLAGS='-arch x86_64'
/path/to/same/python2.7 setup.py install
exit
但如果没有必要,最好不要这样做。
但正如你所见……它并没有按计划进行:
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ sudo rm -rf ./dist ARCHFLAGS='arch x86_64' python setup.py install
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ ipython
-bash: ipython: command not found
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ sudo rm -rf ./dist
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ ARCHFLAGS='-arch x86_64' python setup.py install
python: can't open file 'setup.py': [Errno 2] No such file or directory
Eddy-Lopez-Torres-Computer:LabTools-0.2.2 eddylopez-torres$ sudo bash
root@Eddy-Lopez-Torres-Computer:~/Downloads/LabTools-0.2.2# export ARCHFLAGS=' arch x86_64'root@Eddy-Lopez-Torres-Computer:~/Downloads/LabTools-0.2.2# /path/to/same/python2.7 setup.py install
bash: /path/to/same/python2.7: No such file or directory
root@Eddy-Lopez-Torres-Computer:~/Downloads/LabTools-0.2.2# exit
任何帮助将不胜感激。非常感谢!
【问题讨论】:
标签: python linux bash python-2.7 installation