pip3 install Flask-MongoEngine安装失败

时间:2018-08-05 17:12:39

标签: python python-3.x mongoengine setup.py flask-mongoengine

我想用Python 3.4安装Flask-MongoEngine,这是Mac上安装的。当我尝试通过pip3安装Flask-MongoEngine时,出现以下错误,不确定如何解决?

sudo pip3 install Flask-MongoEngine


    The directory '/Users/mastarke/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    The directory '/Users/mastarke/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Collecting Flask-MongoEngine
      Downloading https://files.pythonhosted.org/packages/20/53/1bb8ad34ad5c2047a11651290325e55086bc18fce7cfdbbe6f5522bd0ae5/flask-mongoengine-0.9.5.tar.gz (111kB)
        100% |████████████████████████████████| 194kB 4.0MB/s 
        Complete output from command python setup.py egg_info:
        Download error on https://pypi.python.org/simple/rednose/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:600) -- Some packages may not be found!
        Couldn't find index page for 'rednose' (maybe misspelled?)
        Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:600) -- Some packages may not be found!
        No local packages or download links found for rednose
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
          File "/private/tmp/pip-install-6wad5e5g/Flask-MongoEngine/setup.py", line 74, in <module>
            'Topic :: Software Development :: Libraries :: Python Modules'
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/dist.py", line 269, in __init__
            self.fetch_build_eggs(attrs['setup_requires'])
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/dist.py", line 313, in fetch_build_eggs
            replace_conflicting=True,
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources/__init__.py", line 826, in resolve
            dist = best[req.key] = env.best_match(req, ws, installer)
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1092, in best_match
            return self.obtain(req, installer)
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources/__init__.py", line 1104, in obtain
            return installer(requirement)
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/dist.py", line 380, in fetch_build_egg
            return cmd.easy_install(req)
          File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/setuptools/command/easy_install.py", line 658, in easy_install
            raise DistutilsError(msg)
        distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('rednose')

        ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-6wad5e5g/Flask-MongoEngine/

3 个答案:

答案 0 :(得分:0)

这似乎与您的公司代理有关。

答案 1 :(得分:0)

尝试使用pip而不是pip3进行安装,然后大多数情况下要求您进行更新。这可能会有所帮助: class _IframeScreenState extends State<IframeScreen> { Widget _iframeWidget; Widget _iframeWidget2; final IFrameElement _iframeElement = IFrameElement(); final IFrameElement _iframeElement2 = IFrameElement(); List<width> _width; double _height; List<String> _source; _IframeScreenState(List<width> _w, double _h, List<String> _src,){ _width = _w; _height = _h; _source = _src; } @override void initState() { super.initState(); _iframeElement.src = _source[0]; _iframeElement.style.border = 'none'; _iframeElement2.src = _source[1]; _iframeElement2.style.border = 'none'; // ignore: undefined_prefixed_name ui.platformViewRegistry.registerViewFactory( 'iframeElement', (int viewId) => _iframeElement, ); // ignore: undefined_prefixed_name ui.platformViewRegistry.registerViewFactory( 'iframeElement2', (int viewId) => _iframeElement2, ); _iframeWidget = HtmlElementView( key: UniqueKey(), viewType: 'iframeElement', ); _iframeWidget2 = HtmlElementView( key: UniqueKey(), viewType: 'iframeElement2', ); } @override Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.center, children:[ Container( color: Colors.blue, child: SizedBox( height: _height, width: _width[0], child:_iframeWidget[0], ), ), Container( color: Colors.red, child: SizedBox( height: _height, width: _width[1], child:_iframeWidget[1], ), ), ], ); }

答案 2 :(得分:0)

尝试一下-

python -m pip install rednose nose coverage

然后是install flask-mongoengine