I want to check my pyd python module. So, my test.py will import my pyd module.
But can't set PYTHONPATH correct to import this module successfully.
+ umask 000
+ GIT_LFS_SKIP_SMUDGE=1 git clone --branch="pipeline" --depth 50 https://x-token-auth:$REPOSITORY_OAUTH_ACCESS_TOKEN@bitbucket.org/ihshsu/pygrlib.git $BUILD_DIR ; git reset --hard 18d6bf0630c0c64639e7498567e8109eb3ccfd20 ; git remote set-url origin git@bitbucket.org:ihshsu/pygrlib.git
Cloning into '/opt/atlassian/pipelines/agent/build'...
HEAD is now at 18d6bf0 bitbucket-pipelines.yml edited online with Bitbucket
+ chmod 777 $BUILD_DIR
Cache "pip": Downloading
Cache "pip": Not found
+ python --version
Python 3.6.3
+ cd ./pyGRLib
+ export PYTHONPATH=.
+ python test.py
Traceback (most recent call last):
File "test.py", line 1, in <module>
import pyGRLib
ModuleNotFoundError: No module named 'pyGRLib'
Skipping cache upload for failed step
Searching for test report files in directories named [test-results, failsafe-reports, test-reports, surefire-reports] down to a depth of 4
Finished scanning for test reports. Found 0 test report files.
Merged test suites, total number tests is 0, with 0 failures and 0 errors.
export PYTHONPATH=${PYTHONPATH}:/opt/atlassian/pipelines/agent/build:/opt/atlassian/pipelines/agent/build/pyGRlib
this path can work. But .pyd can't be used. Any suggestion ?
Hi Frank,
Is there another directory called pyGRLib under pyGRLib?
+ cd ./pyGRLib
If not then place your script in the same directory as pyGRLib. From here it should import.
pyGRLib test.py
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My module name is pyGRLib.pyd. And test.py will call "import pyGRLib".
But I don't know how to set PYTHONPATH in pipeline environment. I try sys.path.append in test.py but still not work. Any suggestion ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.