Jenkins when you deploy a Python project, you are prompted to find a problem with the module package that you defined

Source: Internet
Author: User

Today try to deploy our automation project on Jenkins, configure it with simple login use cases, and then our project (which I write myself) using Python+selenium,

After setting up the environment, the construction of the time encountered a problem, is always prompted to find my own definition of the module package, prompting the error

modulenotfounderror:no module named ' Common ', as follows:

But I run in the IDE in the Pycharm is normal, do not give up in Cmd run a bit, found with Jenkins above the same problem, and then Baidu a bit finally found the problem lies

Cause: When the IDE is running, all relevant modules are searched, while the cmd command or Jenkins build will only search for modules in the current directory

Workaround:

Project Name: Test

Path of the project in the computer: D:\workspace\test

The working directory for Jenkins builds is: C:\Program Files (x86) \jenkins\workspace\test

1, if running in cmd, you need to configure the system environment variables

Name = PYTHONPATH

Value = D:\workspace\test

2. When building on Jenkins, you need to find the global properties in the System management-system settings in the Jenkins home page to fill in the relevant

Then click Save, rebuild it should be done

Jenkins when you deploy a Python project, you are prompted to find a problem with the module package that you defined

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.