0

I have an Ubuntu 18.04 operating system with two versions of python installed; 3.6 and 2.7. I tried to install Flask-Enterprise for python 3.6 and I got:

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/

But when I install it for python 2.7, everything works fine:

zeinab@ZiZi:~/PycharmProjects/My_Service$ sudo pip2 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 379kB/s 
Requirement already satisfied: Flask>=0.3 in /usr/local/lib/python2.7/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 941kB/s 
Requirement already satisfied: Werkzeug>=0.14 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: click>=5.1 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: Jinja2>=2.10 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: itsdangerous>=0.24 in /usr/local/lib/python2.7/dist-packages (from Flask>=0.3->Flask-Enterprise)
Requirement already satisfied: lxml>=2.2.1 in /usr/local/lib/python2.7/dist-packages (from soaplib->Flask-Enterprise)
Collecting pytz (from soaplib->Flask-Enterprise)
  Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
    100% |████████████████████████████████| 512kB 1.0MB/s 
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/dist-packages (from Jinja2>=2.10->Flask>=0.3->Flask-Enterprise)
Installing collected packages: pytz, soaplib, suds, Flask-Enterprise
  Running setup.py install for soaplib ... done
  Running setup.py install for suds ... done
  Running setup.py install for Flask-Enterprise ... done
Successfully installed Flask-Enterprise-1.0 pytz-2018.9 soaplib-1.0.0 suds-0.4

I found this answer and I installed suds-jurko as an alternative for suds, then tried to install Flask-Enterprise again; I got the same error.

EDIT 1:

I tried to install it in a virtual environment, but I got identical results:

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/
Zeinab Abbasimazar
  • 9,835
  • 23
  • 82
  • 131

1 Answers1

-1
  1. create a virtual environment by using virtualenv or pipenv. simply run: virtualenv -p python3 envname
  2. use this newly created python3 environment as your project interpreter/environment.
  3. open terminal and run following command to activate your environment: source envname/bin/activate
  4. now install Flask-Enterprise in this virtualenv by using: pip3 install Flask-Enterprise
raihan_s
  • 1
  • 1
  • I don't see how this solves the issues posted by the OP? – roganjosh Jan 26 '19 at 08:31
  • I think this error is occurred for the reason of overloading the package.See: Requirement already satisfied: Flask>=0.3 in /usr/local/lib/python3.6/dist-packages (from Flask-Enterprise) Collecting soaplib (from Flask-Enterprise) – raihan_s Jan 26 '19 at 08:37
  • And directly trying to install package in python root directory.why not you trying to install it in a virtual environment? – raihan_s Jan 26 '19 at 08:40
  • 1
    That's not what that line means. It means that it checked to see whether the user has a Flask version greater than 0.3. They do. That is not an error and it's not overloading a package. – roganjosh Jan 26 '19 at 08:42
  • 1
    And they're not installing into root. This is a scattergun of suggestions. – roganjosh Jan 26 '19 at 08:43
  • Sorry there is a correction. Please use python2 for using Flask-Enterprise. Python3 has some problem with Flask-Enterprise. virtualenv -p python2 envname source envname/bin/activate pip2 install Flask-Enterprise. worked for me. – raihan_s Jan 26 '19 at 08:47
  • 1
    That's the entire point of the question...they already know it works in 2.7 and want to use in Python 3. All of this was clearly shown in the main post. Please make sure you fully understand what is being asked before posting an answer; guesswork is not helpful. – roganjosh Jan 26 '19 at 08:51