Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[CFME][Automation][Python_Quickstart_script] – When trying to run the python ‘quickstart’ script using python3, the script fails #10335

Open
ikanias opened this issue Sep 29, 2020 · 10 comments

Comments

@ikanias
Copy link

ikanias commented Sep 29, 2020

Summary: [CFME][Automation][Python_Quickstart_script] – When trying to run the python ‘quickstart’ script using python3, the script fails

Bug severity: Critical

Description:

  1. Make sure you have Python 3.7 installed on your machine

  2. Configure the automation environment according to the following steps:

    • mkdir cfme
    • cd cfme
    • git clone https://github.com/ManageIQ/integration_tests/
    • cd integration_tests/conf/
    • echo >.yaml_key
    • python3 -m cfme.scripting.quickstart

Expected Result:
The script will function properly and a new /cfme_venv folder will be created alongside the ‘integration_tests’ and the ‘cfme-qe-yamls’ folders. In addition the automation environment will be configured successfully.

Actual Result:
When running the ‘python3 -m cfme.scripting.quickstart’ command there is an error message saying that the ‘Feature’ name could not be imported from 'setuptools' and the script fails.

The error received is:

QS $ yum install -y python2-virtualenv gcc postgresql-devel libxml2-devel libxslt-devel zeromq3-devel libcurl-devel redhat-rpm-config gcc-c++ openssl-devel libffi-devel python-devel tesseract freetype-devel    yum-utils
QS $ debuginfo-install -y python2 python3
INFO: Virtualenv .cfme_venv already exists, skipping creation
QS $ .cfme_venv/bin/pip install -r requirements/frozen.py3.txt --no-binary pycurl --no-binary azure-cosmosdb-table -q # this may take some time to finish ...
    ERROR: Command errored out with exit status 1:
     command: /root/cfme/integration_tests/.cfme_venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sxg3vblj/markupsafe/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sxg3vblj/markupsafe/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-b2rlyb7h
         cwd: /tmp/pip-install-sxg3vblj/markupsafe/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-sxg3vblj/markupsafe/setup.py", line 6, in <module>
        from setuptools import setup, Extension, Feature
    ImportError: cannot import name 'Feature' from 'setuptools' (/root/cfme/integration_tests/.cfme_venv/lib/python3.7/site-packages/setuptools/__init__.py)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the '/root/cfme/integration_tests/.cfme_venv/bin/python3 -m pip install --upgrade pip' command.
Running command failed!
CalledProcessError(1, ['.cfme_venv/bin/pip', 'install', '-r', 'requirements/frozen.py3.txt', '--no-binary', 'pycurl', '--no-binary', 'azure-cosmosdb-table', '-q'])
@ikanias ikanias changed the title CFME][Automation][Python_Quickstart_script] – When trying to run the python ‘quickstart’ script using python3, the script fails [CFME][Automation][Python_Quickstart_script] – When trying to run the python ‘quickstart’ script using python3, the script fails Oct 7, 2020
@mshriver
Copy link
Member

mshriver commented Oct 7, 2020

From the output it looks like this is on a re-run of quickstart, as the venv already existed. What OS and version are you running on? Quickstart's first logged line is the identified OS and version, which I don't see in your output

@ikanias
Copy link
Author

ikanias commented Oct 7, 2020 via email

@jawatts
Copy link
Contributor

jawatts commented Oct 7, 2020

Can you try removing cfme_venv and rerunning again. Please paste the entire output

@mshriver
Copy link
Member

mshriver commented Oct 7, 2020

trying to recreate - btw RHEL 7.5 was EOL back in April, might be time for an upgrade.

@ikanias
Copy link
Author

ikanias commented Oct 7, 2020 via email

@andyvesel
Copy link

@ikanias it looks like your development env hasn't been activated.
Activate the development environment by . ../cfme_venv/bin/activate
Check this out ^

@ikanias
Copy link
Author

ikanias commented Oct 8, 2020

I cannot activate it because the script 'python3 -m cfme.scripting.quickstart' that should create the environment is not working (That's what this issue was opened for).

@andyvesel
Copy link

andyvesel commented Oct 8, 2020

I tried to make steps from https://cfme-tests.readthedocs.io/en/master/getting_started.html, and run quickstart. Even though I haven't run further steps (selenium server, etc), the script itself worked without errors.

~/c/integration_tests (master|…) $ python -m cfme.scripting.quickstart                                                                                        Thu 08 Oct 2020 11:21:50 AM CEST
OS_NAME: Fedora, OS_VERSION: 31
QS $ sudo dnf install -y gcc postgresql-devel libxml2-devel libxslt-devel zeromq-devel libcurl-devel redhat-rpm-config gcc-c++ openssl-devel libffi-devel python3 python3-pip python3-devel tesseract freetype-devel  git 'dnf-command(debuginfo-install)'
[sudo] password for aveselov: 
INFO: Virtualenv .cfme_venv already exists, skipping creation
QS $ .cfme_venv/bin/pip3 install -U pip wheel setuptools setuptools_scm docutils pbr
INFO: skipping requirement installation as frozen ones didn't change
      to enforce please invoke pip manually
QS $ .cfme_venv/bin/python3 -m cfme.scripting.disable_bytecode
QS $ .cfme_venv/bin/pip3 install -q -e .
QS $ .cfme_venv/bin/python3 -m cfme.scripting.link_config ../cfme-qe-yamls/complete/ conf
QS $ .cfme_venv/bin/python3 -c 'import curl'
INFO: please remember to activate the virtualenv via
      . .cfme_venv/bin/activate

Please make sure that you have made touch conf/yaml.key and cp conf/env.yaml.template conf/env.yaml before running the script

@ikanias
Copy link
Author

ikanias commented Oct 8, 2020 via email

@ikanias
Copy link
Author

ikanias commented Oct 28, 2020

Re-installed my BM with RHEL 7.9 and CFME 5.11.9.0 and Python 3.7.9.
Then needed to install docker too. After all of that ran /usr/src/Python-3.7.9/python -m cfme.scripting.quickstart and it worked.
Ran '. ../cfme_venv/bin/activate' then 'docker pull cfmeqe/sel_ff_chrome' and then ran 'miq selenium-container'.
Then I ran 'miq-runtest --collect-only' and got errors probably because no cloning of 'https://gitlab.cee.redhat.com/cfme-qe/cfme-qe-yamls/' was done. Currently I have a certificate issue - working on it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants