【发布时间】:2014-08-15 01:28:06
【问题描述】:
我确实在我的根目录中安装了 Flask,但是每当我更改目录并运行 virutalenv venv 以尝试通过 pip install flask 安装烧瓶时,我都会收到以下错误
bash: /home/phillipsk/rampup/sql/venv/bin/easy_install: /home/phillipsk/rampup/webapp/sql/venv/bin/python: bad interpreter: No such file or directory
这里是venv目录的内容
activate activate.csh activate.fish activate_this.py easy_install easy_install-2.7 pip pip2 pip2.7 python python2 python2.7
我可以跑/home/phillipsk/rampup/webapp/sql/venv/bin/python
python 解释器打开
Python 2.7.6
这里是 ls -l
/home/phillipsk/rampup/webapp/sql/venv/bin/python
-rwxr-xr-x 1 root root 3349512 Aug 15 13:11 /home/phillipsk/rampup/webapp/sql/venv/bin/python
这是我尝试运行pip install flask
> (venv)phillipsk@phillips:~/rampup/webapp/sql/venv/bin$ pip install flask Downloading/unpacking flask Cleaning up... Exception: Traceback
> (most recent call last): File
> "/home/phillipsk/rampup/webapp/sql/venv/local/lib/python2.7/site-packages/pip/basecommand.py",
> line 122, in main
> status = self.run(options, args) File "/home/phillipsk/rampup/webapp/sql/venv/local/lib/python2.7/site-packages/pip/commands/install.py",
> line 278, in run
> requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File
> "/home/phillipsk/rampup/webapp/sql/venv/local/lib/python2.7/site-packages/pip/req.py",
> line 1153, in prepare_files
> location = req_to_install.build_location(self.build_dir, not self.is_download) File
> "/home/phillipsk/rampup/webapp/sql/venv/local/lib/python2.7/site-packages/pip/req.py",
> line 218, in build_location
> _make_build_dir(build_dir) File "/home/phillipsk/rampup/webapp/sql/venv/local/lib/python2.7/site-packages/pip/req.py",
> line 1527, in _make_build_dir
> os.makedirs(build_dir) File "/home/phillipsk/rampup/webapp/sql/venv/lib/python2.7/os.py", line
> 157, in makedirs
> mkdir(name, mode) OSError: [Errno 13] Permission denied: '/home/phillipsk/rampup/webapp/sql/venv/build'
>
> Storing debug log for failure in /home/phillipsk/.pip/pip.log
sudo pip install flask 确实可以工作,但无论在运行任一 pip 命令后,我都会立即进入 python 解释器,import flask 没有成功
【问题讨论】:
-
你能手动运行
/home/phillipsk/rampup/webapp/sql/venv/bin/python吗? -
请显示
ls -l /home/phillipsk/rampup/webapp/sql/venv/bin/python,如果它是一个符号链接,则显示ls -l作为它的目标。