尝试pip安装flas时解释器错误

2024-09-29 23:22:14 发布

您现在位置:Python中文网/ 问答频道 /正文

我确实在根目录下安装了Flask,但是每当我更改目录并运行virutalenv venv试图通过pip install Flask安装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

这是的l-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都没有成功


Tags: installpipinpybuildhomesqlbin
3条回答
ImageView img = (ImageView) findViewById(R.id.img1);

看起来id img1RelativeLayoutout而不是ImageView

我希望你正在安卓系统中铸造一个RelativeLayoutImageView。检查xml文件中的R.id.img1是什么

检查logcat,它显示此错误。 java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.widget.ImageView 在使用ImageView之前,请检查其id

相关问题 更多 >

    热门问题