免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 5684 | 回复: 3
打印 上一主题 下一主题

如何搭建flask环境? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-08-18 09:54 |只看该作者 |倒序浏览
我安装了 python2.7.3 ,放在 d:\Python27\python  ,并且创建了g:\microblog, 下载了 virtualenv.py并放在g:\microblog
cd   g:\microblog,

http://blog.miguelgrinberg.com/p ... o-world#commentform
按照那个网页的提示做:

    g:\microblog>d:\Python27\python  virtualenv.py flask
    Overwriting flask\lib\orig-prefix.txt with new content
    New python executable in flask\Scripts\python.exe
    Traceback (most recent call last):
      File "g:\microblog\flask\lib\site.py", line 67, in <module>
        import os
      File "g:\microblog\flask\lib\os.py", line 397
        yield from walk(new_path, topdown, onerror, followlinks)
                 ^
    SyntaxError: invalid syntax
    ERROR: The executable flask\Scripts\python.exe is not functioning
    ERROR: It thinks sys.prefix is u'g:\\microblog' (should be u'g:\\microblog\\flas
    k')
    ERROR: virtualenv is not compatible with this system or executable
    Note: some Windows users have reported this error when they installed Python for
     "Only this user" or have multiple versions of Python installed. Copying the app
    ropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem.


  dir D:\Python27\DLLs

     

     Directory of D:\Python27\DLLs

    08/18/2014  09:36 AM    <DIR>          .
    08/18/2014  09:36 AM    <DIR>          ..
    04/10/2012  11:31 PM            59,904 bz2.pyd
    03/08/2011  09:39 AM            19,790 py.ico
    03/08/2011  09:39 AM            19,790 pyc.ico
    04/10/2012  11:31 PM           103,424 pyexpat.pyd
    04/10/2012  11:31 PM             9,728 select.pyd
    04/10/2012  11:31 PM           337,920 sqlite3.dll
    08/28/2010  02:42 PM           867,840 tcl85.dll
    08/28/2010  02:42 PM             8,192 tclpip85.dll
    08/28/2010  02:45 PM         1,320,448 tk85.dll
    04/10/2012  11:31 PM           686,592 unicodedata.pyd
    04/10/2012  11:31 PM             8,704 winsound.pyd
    04/10/2012  11:32 PM           877,056 _bsddb.pyd
    04/10/2012  11:31 PM            74,240 _ctypes.pyd
    04/10/2012  11:31 PM            13,824 _ctypes_test.pyd
    04/10/2012  11:31 PM            70,656 _elementtree.pyd
    04/10/2012  11:31 PM           285,184 _hashlib.pyd
    04/10/2012  11:31 PM            46,080 _msi.pyd
    04/10/2012  11:31 PM            23,552 _multiprocessing.pyd
    04/10/2012  11:31 PM            40,960 _socket.pyd
    04/10/2012  11:31 PM            41,984 _sqlite3.pyd
    04/10/2012  11:31 PM           721,920 _ssl.pyd
    04/10/2012  11:31 PM            29,184 _testcapi.pyd
    04/10/2012  11:31 PM            30,208 _tkinter.pyd
                  23 File(s)      5,697,180 bytes
                   2 Dir(s)   5,159,092,224 bytes free

没有发现python27.dll这样的文件,请问,如何处理?

论坛徽章:
0
2 [报告]
发表于 2014-08-18 10:07 |只看该作者
从后面的教程来看:
If you are on Windows the commands are slightly different:

flask\Scripts\pip install flask==0.9
flask\Scripts\pip install flask-login
flask\Scripts\pip install flask-openid
flask\Scripts\pip install sqlalchemy==0.7.9
flask\Scripts\pip install flask-sqlalchemy==0.16
flask\Scripts\pip install sqlalchemy-migrate==0.7.2
flask\Scripts\pip install flask-whooshalchemy==0.55a
flask\Scripts\pip install flask-wtf==0.8.4
flask\Scripts\pip install pytz==2013b
flask\Scripts\pip install flask-babel==0.8
flask\Scripts\pip install flup

pip 也安装到flask\Scripts\ 里面了,但是我的flask\Scripts\里面只有两个文件

python.exe  pythonw.exe .

论坛徽章:
0
3 [报告]
发表于 2014-08-18 22:27 |只看该作者
在python安装完之后,安装flask只需要pip install flask即可。测试安装上了没就打开交互式shell, import flask看下就好了

论坛徽章:
0
4 [报告]
发表于 2014-08-19 08:55 |只看该作者
根据作者的描述,按照他的操作,可以形成这样的文件结构。
\microblog
                \flask
                        \Scripts
                                   \pip

我发现,做不到,请您找到网址操作一遍。

http://blog.miguelgrinberg.com/p ... o-world#commentform
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP