New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api authentication is not working #460
Comments
Hi @jaydip189 It looks like an import conflict. Rename your |
Hi @gpocentek Renamed auth.py but some how api authentication is not working.I want to create project dynamically. #!/usr/bin/env python class gitlab(object):
|
You need to use:
|
@gpocentek but it's unable to fetch gitlab attributes like (e.g create project , create repo) |
@jaydip189 Could you provide a complete code example that I could use to reproduce the error? And also provide the complete error you're getting. Without this information I won't be able to help. Thank you. |
@gpocentek please help me outta of this.I need to only api authentication with github (private token) This is the entire code of python and getting error AttributeError: module 'gitlab' has no attribute 'Gitlab' import gitlab def g1(): gl = gitlab.Gitlab('http://gitlab.com', private_token='xxxxxxxxxx') projects = gl.projects.list() def g1(): def projects(): g1() |
Make sure that the path displayed is the |
(venv) λ python
|
What does |
|
The only thing I can think of is that you still have a |
need to declare variable of g1 right? |
@gpocentek gitlab api connection is working fine now.Thanks for your help. |
#!/usr/bin/env python class gitlab(object): def g1(self):
class projects(object): |
@gpocentek In python shell I'm getting output of project list , groups .but however i'm not getting output when i'm running program.I think projects method will not invoking. |
I'm calling g1.project.create() method,it gives argument passing error.what i need to pass in argument. |
You can find project creation examples in the documentation: http://python-gitlab.readthedocs.io/en/stable/gl_objects/projects.html |
project = gl.projects.create({'name': 'project1'}) is not working.it gives data argument error. File "test.py", line 32, in |
I recommend you start with learning python because you are clearly not familiar with the language. You are facing beginner issues which have nothing to do with python-gitlab. I don't have the time to help you learn python. |
Thanks for your help.I will learn python and get back to you if facing any issue with python-gitlab. |
Gitlab version 1.0.2
just bumped into this one, any ideas what is happening here? |
@kitten77 make sure you've installed |
Yeah i found that, maybe this is something that should be fixed by renaming the Gitlab() class to PyGitlab() and return a warning deprecated use PyGitlab() ? Just a thought |
The issue I had was the python script I was testing with was called gitlab.py. Obiously, if you try to "import gitlab" then your script is going to import itself. Never call the script you're writing the same thing as what you're trying to import. |
This happened with me as well, and I did the follows:
But the code wasn't working even after removal of
|
I've just written the following to the maintainer of gitlab package:
|
rename filename myGitlab if name is gitlab , error is show |
This solved the issue for me. Thanks. |
api call is not working.
File "auth.py", line 3, in
import gitlab
File "D:\DevOps\gitlab\gitlab.py", line 17, in
g1()
File "D:\DevOps\gitlab\gitlab.py", line 10, in g1
gl = gitlab.Gitlab('http://gitlab.com', oauth_token='rUAuB2dWFxccvbbd')
AttributeError: module 'gitlab' has no attribute 'Gitlab'
In page: api-usage.rst
The text was updated successfully, but these errors were encountered: