Git Product home page Git Product logo

Comments (5)

dserodio avatar dserodio commented on May 27, 2024

Like you install any Python "library":

pip install python-gitlab

from python-gitlab.

TobyHFerguson avatar TobyHFerguson commented on May 27, 2024

I believe the answer is here: http://fedir.github.io/web/2014/01/06/gitlab-projects-management-from-shell/#installation, which says:

git clone https://github.com/gpocentek/python-gitlab.git
cd python-gitlab
python setup.py install

But that gave me this error:

[toby.ferguson@XXXX python-gitlab]$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 7, in <module>
    import gitlab
  File "/home/toby.ferguson/python-gitlab/gitlab/__init__.py", line 26, in <module>
    import requests
ImportError: No module named requests

Now I just have to figure out how to install requests

from python-gitlab.

TobyHFerguson avatar TobyHFerguson commented on May 27, 2024

So the trick is to install pip, and then use it:

[toby.ferguson@ca-ovsx32 python-gitlab]$ curl -O https://bootstrap.pypa.io/get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1388k  100 1388k    0     0   849k      0  0:00:01  0:00:01 --:--:--  934k
[toby.ferguson@ca-ovsx32 python-gitlab]$ su 
Password: 
[root@ca-ovsx32 python-gitlab]# python get-pip.py
/usr/lib/python2.6/site-packages/setuptools/command/install_scripts.py:3: UserWarning: Module pip was already imported from /tmp/tmpjqAJHB/pip.zip/pip/__init__.py, but /usr/lib/python2.6/site-packages is being added to sys.path
  from pkg_resources import Distribution, PathMetadata, ensure_directory
/tmp/tmpjqAJHB/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
/tmp/tmpjqAJHB/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
Collecting pip
  Downloading pip-7.0.3-py2.py3-none-any.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 230kB/s 
Collecting wheel
  Downloading wheel-0.24.0-py2.py3-none-any.whl (63kB)
    100% |████████████████████████████████| 65kB 2.4MB/s 
Collecting argparse (from wheel)
  Downloading argparse-1.3.0-py2.py3-none-any.whl
Installing collected packages: pip, argparse, wheel
  Found existing installation: pip 1.3.1
    Uninstalling pip-1.3.1:
      Successfully uninstalled pip-1.3.1
Successfully installed argparse-1.3.0 pip-7.0.3 wheel-0.24.0
[root@ca-ovsx32 python-gitlab]# pip install python-gitlab
Collecting python-gitlab
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading python-gitlab-0.9.1.tar.gz
Collecting requests (from python-gitlab)
  Downloading requests-2.7.0-py2.py3-none-any.whl (470kB)
    100% |████████████████████████████████| 471kB 424kB/s 
Collecting six (from python-gitlab)
  Downloading six-1.9.0-py2.py3-none-any.whl
Building wheels for collected packages: python-gitlab
  Running setup.py bdist_wheel for python-gitlab
  Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-N1G53N/python-gitlab/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpvwxELMpip-wheel-:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

  ----------------------------------------
  Failed building wheel for python-gitlab
Failed to build python-gitlab
Installing collected packages: requests, six, python-gitlab
  Running setup.py install for python-gitlab
Successfully installed python-gitlab-0.9.1 requests-2.7.0 six-1.9.0

and to ignore that 'wheel error' at the end

from python-gitlab.

TobyHFerguson avatar TobyHFerguson commented on May 27, 2024

No - that wasn't enough - even thought the last line seemed to indicate requests and six were installed I got the following errors:

[root@ca-ovsx32 python-gitlab]# gitlab --help
Traceback (most recent call last):
  File "/usr/bin/gitlab", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
    working_set.require(__requires__)
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: six

I fixed this using easy_install:

easy_install six requests

and NOW this gitlab tool works! Yay!

from python-gitlab.

gpocentek avatar gpocentek commented on May 27, 2024

Using pip to install python software is a common practice, and would have helped you in this case. Glad you got it working.

from python-gitlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.