python - Flask 安装不正常

标签 python flask

我正在使用 Merverick OSX。我已经在我的电脑上安装了 Python 3.3.3,我想安装 Flask

当我在终端中输入这个时

$sudo easy_install virtualenv

终端向我显示这个错误

error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-    
373.write-test'

The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:

/Library/Python/2.7/site-packages/

Perhaps your account does not have write access to this directory?  If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account.  If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.

For information on other options, you may wish to consult the
documentation at:

http://peak.telecommunity.com/EasyInstall.html

Please make the appropriate changes for your system and try again.

所以我可以作为 root 用户访问,然后键入

$sudo easy_install virtualenv

它是这样写的,但是有一个关于 *.egg 的警告那是什么?出了什么问题?以及如何解决?

Last login: Wed Nov 13 16:10:17 on ttys000
Tammarats-MacBook-Air:~ Team$ su root
Password:
sh-3.2# $sudo easy_install virtualenv
Searching for virtualenv
Reading http://pypi.python.org/simple/virtualenv/
Best match: virtualenv 1.10.1
Downloading https://pypi.python.org/packages/source/v/virtualenv/virtualenv-   
1.10.1.tar.gz#md5=3a04aa2b32c76c83725ed4d9918e362e
Processing virtualenv-1.10.1.tar.gz
Running virtualenv-1.10.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-  
Nl7IVa/virtualenv-1.10.1/egg-dist-tmp-QGa1nR
warning: no files found matching '*.egg' under directory 'virtualenv_support'
warning: no previously-included files matching '*' found under directory  
'docs/_templates'
warning: no previously-included files matching '*' found under directory 'docs/_build'
Adding virtualenv 1.10.1 to easy-install.pth file
Installing virtualenv script to /usr/local/bin
Installing virtualenv-2.7 script to /usr/local/bin

Installed /Library/Python/2.7/site-packages/virtualenv-1.10.1-py2.7.egg
Processing dependencies for virtualenv
Finished processing dependencies for virtualenv
sh-3.2# 

最佳答案

每次遇到这样不能理解的事情,都要详细看解释。 你找到“警告”了吗,它告诉你这不是错误;和

  Installed /Library/Python/2.7/site-packages/virtualenv-1.10.1-py2.7.egg    
  Processing dependencies for virtualenv
  Finished processing dependencies for virtualenv

说实话你已经安装成功了virtualenv。 现在你可以根据Flask给的文档,学习Flask了;

关于python - Flask 安装不正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19949882/

相关文章:

Python 列表元素交换未按预期工作

python - 由于 Flask 路由错误,在本地开发服务器中查看 Google App Engine Python 回溯

python - 同时按 2 个键可对角移动 tkinter?

python - 带折线图的条形图 - 使用非数字索引

python - Flask-Admin ModelView 中的只读文本字段

python - 使用 WTForms 字段列表

javascript - 我在 Flask 应用程序中使用 $.(get) 请求时遇到的 JavaScript 问题

python - 具有动态路径的 send_from_directory

python - 为什么 'WriteOnlyWorksheet' 对象没有属性 'cell' ?

Python 嵌套函数不等于其自身