Thursday 12 November 2020

Python Module is not getting installed

I was trying to install a python module in my server andwas not able to get this installed.While i run my JOB in JENKINS i was getting the below issue

18:26:00 + export PYTHONPATH=:/home/jenkins/source/python
18:26:00 + cd /home/jenkins/source/python/connectors/Sendinblue
18:26:00 + python3.8 -u send_in_blue_real_time.py
18:26:00 Traceback (most recent call last):
18:26:00   File "send_in_blue_real_time.py", line 1, in <module>
18:26:00     import sib_api_v3_sdk
18:26:00 ModuleNotFoundError: No module named 'sib_api_v3_sdk'
18:26:00 Build step 'Execute shell' marked build as failure
18:26:00 Finished: FAILURE

Below is the build commands i put in JENKINS, For all other scripts this is running fine except for this due to the module not found error.

Any suggestions?

export PYTHONPATH=${PYTHONPATH}:/home/jenkins/source/python
cd /home/jenkins/source/python/connectors/Sendinblue

python3.8 -u send_in_blue_real_time.py

Below is the terminal commands when i try to install the module.

admin@jenkins:~$ sudo su jenkins
jenkins@jenkins:/home/admin$ pip3 install sib_api_v3_sdk
Collecting sib_api_v3_sdk
  Cache entry deserialization failed, entry ignored
Collecting certifi>=2017.4.17 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting urllib3>=1.23 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl
Collecting python-dateutil>=2.1 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.10 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Installing collected packages: certifi, urllib3, six, python-dateutil, sib-api-v3-sdk
Successfully installed certifi-2020.6.20 python-dateutil-2.8.1 sib-api-v3-sdk-7.0.0 six-1.15.0 urllib3-1.25.11
jenkins@jenkins:/home/admin$ python3 -m pip install sib_api_v3_sdk
Collecting sib_api_v3_sdk
Collecting urllib3>=1.23 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl
Collecting six>=1.10 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl
Collecting python-dateutil>=2.1 (from sib_api_v3_sdk)
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Installing collected packages: urllib3, certifi, six, python-dateutil, sib-api-v3-sdk
Successfully installed certifi-2020.6.20 python-dateutil-2.8.1 sib-api-v3-sdk-7.0.0 six-1.15.0 urllib3-1.25.11
jenkins@jenkins:/home/admin$ 

Tried the below ones:

pip3 install sib_api_v3_sdk

Switch into Jenkins user by

sudo su jenkins
python3 -m pip install sib_api_v3_sdk 

Tried pip3.8 install sib_api_v3_sdk this as well

jenkins@jenkins:/home/admin$ pip3.8 install sib_api_v3_sdk
Collecting sib_api_v3_sdk
  Using cached https://files.pythonhosted.org/packages/ee/e5/d282b9bf7d34fc6e9041b07139fbaed962f8e55711c3f8523072f473d828/sib-api-v3-sdk-7.0.0.tar.gz
Requirement already satisfied: certifi>=2017.4.17 in /var/lib/jenkins/.local/lib/python3.8/site-packages (from sib_api_v3_sdk) (2020.4.5.2)
Requirement already satisfied: python-dateutil>=2.1 in /var/lib/jenkins/.local/lib/python3.8/site-packages (from sib_api_v3_sdk) (2.8.1)
Requirement already satisfied: six>=1.10 in /var/lib/jenkins/.local/lib/python3.8/site-packages (from sib_api_v3_sdk) (1.15.0)
Requirement already satisfied: urllib3>=1.23 in /var/lib/jenkins/.local/lib/python3.8/site-packages (from sib_api_v3_sdk) (1.25.9)
Installing collected packages: sib-api-v3-sdk
  Running setup.py install for sib-api-v3-sdk ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-p89fd0su/sib-api-v3-sdk/setup.py'"'"'; __file__='"'"'/tmp/pip-install-p89fd0su/sib-api-v3-sdk/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-7wc5sv_a/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-p89fd0su/sib-api-v3-sdk/
    Complete output (404 lines):
    running install


from Python Module is not getting installed

No comments:

Post a Comment