I'm using a CentOS7 virtual machine created in Oracle VirtualBox.
I've installed on it python with sudo yum install python3
and then python-gitlab using sudo yum install python-gitlab
I've tried this python code
import gitlab
import os
gl = gitlab.Gitlab(url='https://<my gitab instance>/', private_token='my_token')
def get_projects():
projects = gl.projects.list(owned=True)
for project in projects:
print(project.name)
def main():
get_projects()
main()
but it doesn't wok and the error is
Traceback (most recent call last):
File "Test.py", line 1, in <module>
import gitlab
File "/media/sf_SharedWithVM/VM-Python/GitLab/gitlab.py", line 6, in <module>
AttributeError: 'module' object has no attribute 'Gitlab'
Any suggestion will be appreciated. Thank you in advance