无法在Ubuntu 18.04上安装FlaskEnterpriseforPython3.6

2024-09-29 19:30:13 发布

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

我有一个Ubuntu 18.04操作系统,安装了python的两个版本:3.6和2.7。我试图为python3.6安装Flask-Enterprise,得到了:

zeinab@ZiZi:~/PycharmProjects/My_Service$ sudo pip3 install Flask-Enterprise
The directory '/home/zeinab/.cache/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 '/home/zeinab/.cache/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-Enterprise
  Downloading https://files.pythonhosted.org/packages/a7/8d/635300aaae97541c8734b83acb4534cbfd879fcf2e2d3f31ced4c3524274/Flask-Enterprise-1.0.tar.gz (78kB)
    100% |████████████████████████████████| 81kB 359kB/s 
Requirement already satisfied: Flask>=0.3 in /usr/local/lib/python3.6/dist-packages (from Flask-Enterprise)
Collecting soaplib (from Flask-Enterprise)
  Downloading https://files.pythonhosted.org/packages/b9/96/44957abd425b50e69848e43ab2c472839390038e3ede611346110b83a2da/soaplib-1.0.0.tar.gz
Collecting suds (from Flask-Enterprise)
  Downloading https://files.pythonhosted.org/packages/bc/d6/960acce47ee6f096345fe5a7d9be7708135fd1d0713571836f073efc7393/suds-0.4.tar.gz (104kB)
    100% |████████████████████████████████| 112kB 940kB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-7fa4v00d/suds/setup.py", line 20, in <module>
    import suds
      File "/tmp/pip-build-7fa4v00d/suds/suds/__init__.py", line 154, in <module>
    import client
    ModuleNotFoundError: No module named 'client'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7fa4v00d/suds/

但当我为python 2.7安装它时,一切正常:

^{pr2}$

我找到了this answer,我安装了suds-jurko,作为suds的替代品,然后再次尝试安装Flask-Enterprise;我得到了相同的错误。在

编辑1:

我试图在虚拟环境中安装它,但得到了相同的结果:

zeinab@Snapp:~$ virtualenv -p python3 testenv
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /home/zeinab/testenv/bin/python3
Also creating executable in /home/zeinab/testenv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
zeinab@Snapp:~$ source  testenv/bin/activate
(testenv) zeinab@Snapp:~$ pip3 install Flask-Enterprise
Collecting Flask-Enterprise
  Downloading https://files.pythonhosted.org/packages/a7/8d/635300aaae97541c8734b83acb4534cbfd879fcf2e2d3f31ced4c3524274/Flask-Enterprise-1.0.tar.gz (78kB)
    100% |████████████████████████████████| 81kB 407kB/s 
Collecting Flask>=0.3 (from Flask-Enterprise)
  Using cached https://files.pythonhosted.org/packages/7f/e7/08578774ed4536d3242b14dacb4696386634607af824ea997202cd0edb4b/Flask-1.0.2-py2.py3-none-any.whl
Collecting soaplib (from Flask-Enterprise)
  Downloading https://files.pythonhosted.org/packages/b9/96/44957abd425b50e69848e43ab2c472839390038e3ede611346110b83a2da/soaplib-1.0.0.tar.gz
Collecting suds (from Flask-Enterprise)
  Downloading https://files.pythonhosted.org/packages/bc/d6/960acce47ee6f096345fe5a7d9be7708135fd1d0713571836f073efc7393/suds-0.4.tar.gz (104kB)
    100% |████████████████████████████████| 112kB 1.1MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-8am_aqio/suds/setup.py", line 20, in <module>
        import suds
      File "/tmp/pip-install-8am_aqio/suds/suds/__init__.py", line 154, in <module>
        import client
    ModuleNotFoundError: No module named 'client'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-8am_aqio/suds/

Tags: pipinfrompyhttpsorgflaskpackages
1条回答
网友
1楼 · 发布于 2024-09-29 19:30:13
  1. 使用virtualenv或pipenv创建虚拟环境。 只需运行: virtualenv-p python3环境名称
  2. 使用这个新创建的python3环境作为您的项目解释器/环境。在
  3. 打开终端并运行以下命令以激活您的环境: 源环境名称/bin/activate
  4. 现在在这个virtualenv中安装Flask Enterprise,方法是: pip3安装烧瓶企业

相关问题 更多 >

    热门问题