Jenkins was configured in the tutorial yesterday, but there are always errors. Summarize the two problems encountered
1. It can run normally in pycharm, but the error “no module named ‘xxx” is always reported under Jenkins. It is also reported by using the command line alone. The reason for checking online is
In pycharm, all folder paths of the current project will be used as the package search path at runtime, while only the current path will be searched by default on the command line, and the package will not be found
To solve this problem, I used a stupid method to add the paths of the current folder to the search path through sys. Path. Append()
After adding the path, run the code from the command line successfully
2. The second problem is that after running successfully through the command line, Jenkins still reports an error. It reports that the module in the python directory cannot be found. After checking, it is said on the Internet that Jenkins may have permission to read some folders
The solution is as follows
Run – > services.msc
Find Jenkins
Right click – properties – login – this account
Select an account with permission (you must have a login password, otherwise an error will occur when restarting the service)
After application, restart the service
Rebuild in Jenkins and run successfully
Similar Posts:
- [Solved] Jenkins Run python Project Error: “ModuleNotFoundError: No module named ‘xxx‘”
- Jenkins – mvn: command not found
- An error is reported when the docker command is executed in Jenkins
- How does MAC uninstall Jenkins
- Jenkins ios rror: No signing certificate “iOS Distribution” found: No “iOS Dist…
- [How to Solve] directory not found for option
- Jenkins configuring SVN Error: javax.net.ssl.SSLProtocolException: handshake alert: unrecognized_name
- [Solved] Mac Error: PermissionError: [Errno 1] Operation not permitted: ‘xxxx’
- Gevent Install Error: Could not build wheels for gevent which use PEP 517 and cannot be installed directly
- Importerror: no module named * [How to Solve]