Use jenkins to manage my python code, because the python3.5 version is used, first use virtualenv on ubuntu to generate a python3.5 virtual operating environment
virtualenv -p /usr/bin/python3.5 --no-site-packages python3.5
The virtualenv command is to create an "independent" runtime environment for python, because when there are multiple versions of our system, and when 2 and 3 are completely incompatible, at this time we need an independent for each version Operating environment
Let's check what's in this directory
This contains our complete python operating environment, and then the python variable and pip variable are defined on jenkins
Then we created a job. In this job, we use git to pull our code. The code address is on github. After the pull is completed, we set the shell operation to be executed in our custom Execute shell. Prompt that the library psutil needs to be installed, so in the system
pip install psutil
Show that the installation is successful, and then rebuild, through the console output, it is still prompted that there is no psutil library
Second, the problem conjecture
python3.5 setup.py build
The result shows that the x86_64-linux-gnu-gcc command does not exist, but this command does exist in the system, so I suspect that the virtualenv environment may not be common to the outside environment
Three, solve the problem
Because python3 is used in the file, the development package of python3 should be used, so install his development package
sudo apt-get install python3-dev
sudo apt-get upgrade
Then use in the psutil package
python3.5 setup.py build
python3.5 setup.py install
Solve the problem completely.
Recommended Posts