Discussion Forum

Install python grakn-client as part of a bigger project

Hi,
Maybe something very stupid missed my eye but I seem to be unable to add grakn-client to my project.
Installing it independently worked fine but when mixing it with other packages I seem to encounter an issue.
I am working with a Windows machine and the CI/CD runs inside a docker container with linux. Both use pipenv and have the same problem:

ERROR: ERROR: Could not find a version that matches six<2,2.0,==1.11.0,>=1.10.0,>=1.12,>=1.5,>=1.5.2,>=1.9,>=1.9.0

which comes from: https://github.com/graknlabs/client-python/blob/master/requirements.txt

On a side note, I tried to move the project to poetry (this seemed like a good excuse), but, there, when adding the grakn client I get another error (see below). It may be from the same reason or a known issue in poetry. Yet, none of the other packages gave me any problem so I am guessing it is a combination of problems (maybe due to the dependency locking).

λ poetry add grakn-client -v                                                                                                                       
Using virtualenv: C:\Users\maydanw\AppData\Local\pypoetry\Cache\virtualenvs\proteinfolding-u8Ufqpkg-py3.7                                          
Using version ^1.6.0 for grakn-client                                                                                                              
                                                                                                                                                   
Updating dependencies                                                                                                                              
Resolving dependencies... (0.9s)                                                                                                                   
                                                                                                                                                   
[PermissionError]
[WinError 5] Access is denied: 'C:\\Users\\maydanw\\AppData\\Local\\Temp\\tmp8fa37po0\\unpacked\\grakn-client-1.6.0\\grakn_protocol\\keyspace\\Keyspace_pb2.py'
                                                                                                                                                   
Traceback (most recent call last):                                                                                                                 
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\clikit\console_application.py", line 131, in run                            
    status_code = command.handle(parsed_args, io)                                                                                                  
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\clikit\api\command\command.py", line 120, in handle                         
    status_code = self._do_handle(args, io)                                                                                                        
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\clikit\api\command\command.py", line 171, in _do_handle                     
    return getattr(handler, handler_method)(args, io, self)                                                                                        
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\cleo\commands\command.py", line 92, in wrap_handle                          
    return self.handle()                                                                                                                           
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\console\commands\add.py", line 149, in handle                        
    status = installer.run()                                                                                                                       
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\installation\installer.py", line 74, in run                          
    self._do_install(local_repo)                                                                                                                   
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\installation\installer.py", line 161, in _do_install                 
    ops = solver.solve(use_latest=self._whitelist)                                                                                                 
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\puzzle\solver.py", line 36, in solve                                 
    packages, depths = self._solve(use_latest=use_latest)                                                                                          
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\puzzle\solver.py", line 181, in _solve                               
    self._package, self._provider, locked=locked, use_latest=use_latest                                                                            
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\mixology\__init__.py", line 7, in resolve_version                    
    return solver.solve()                                                                                                                          
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\mixology\version_solver.py", line 80, in solve                       
    next = self._choose_package_version()                                                                                                          
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\mixology\version_solver.py", line 378, in _choose_package_version    
    version = self._provider.complete_package(version)                                                                                             
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\puzzle\provider.py", line 550, in complete_package                   
    repository=package.dependency.source_name,                                                                                                     
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pool.py", line 115, in package                          
    package = repo.package(name, version, extras=extras)                                                                                           
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 161, in package               
    release_info = self.get_release_info(name, version)                                                                                            
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 278, in get_release_info      
    '{}:{}'.format(name, version), lambda: self._get_release_info(name, version)                                                                   
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\cachy\repository.py", line 174, in remember_forever                         
    val = value(callback)                                                                                                                          
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\cachy\helpers.py", line 6, in value                                         
    return val()                                                                                                                                   
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 278, in <lambda>              
    '{}:{}'.format(name, version), lambda: self._get_release_info(name, version)                                                                   
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 345, in _get_release_info     
    info = self._get_info_from_urls(urls)                                                                                                          
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 462, in _get_info_from_urls   
    return self._get_info_from_sdist(urls['sdist'][0])                                                                                             
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\repositories\pypi_repository.py", line 494, in _get_info_from_sdist  
    return self._inspector.inspect_sdist(filepath)                                                                                                 
  File "f:\programdata\anaconda3\lib\contextlib.py", line 119, in __exit__                                                                         
    next(self.gen)                                                                                                                                 
  File "C:\Users\maydanw\AppData\Roaming\Python\Python37\site-packages\poetry\utils\helpers.py", line 43, in temporary_directory                   
    yield name                                                                                                                                     
  File "f:\programdata\anaconda3\lib\tempfile.py", line 805, in __exit__                                                                           
    self.cleanup()                                                                                                                                 
  File "f:\programdata\anaconda3\lib\tempfile.py", line 809, in cleanup                                                                            
    _shutil.rmtree(self.name)                                                                                                                      
  File "f:\programdata\anaconda3\lib\shutil.py", line 513, in rmtree                                                                               
    return _rmtree_unsafe(path, onerror)                                                                                                           
  File "f:\programdata\anaconda3\lib\shutil.py", line 392, in _rmtree_unsafe                                                                       
    _rmtree_unsafe(fullname, onerror)                                                                                                              
  File "f:\programdata\anaconda3\lib\shutil.py", line 392, in _rmtree_unsafe                                                                       
    _rmtree_unsafe(fullname, onerror)                                                                                                              
  File "f:\programdata\anaconda3\lib\shutil.py", line 392, in _rmtree_unsafe                                                                       
    _rmtree_unsafe(fullname, onerror)                                                                                                              
  [Previous line repeated 1 more time]                                                                                                             
  File "f:\programdata\anaconda3\lib\shutil.py", line 397, in _rmtree_unsafe                                                                       
    onerror(os.unlink, fullname, sys.exc_info())                                                                                                   
  File "f:\programdata\anaconda3\lib\shutil.py", line 395, in _rmtree_unsafe                                                                       
    os.unlink(fullname)                                                                                                                            

Any idea how to resolve it (other than forking the client fixing it for myself and installing from there )?
Many thanks

hi,
I have had the same issue with the python client under pipenv, it is because the six library dependency is an equal sign rather than a greater than sign, and so pipenv cannot resolve the dependencies. For example, in my example below this equal sign conflicts with the pylint module, which requires a higher version.

See image below

I hope the Grakn team can change this dependency to a greater than sign to remove this problem

Hi - we’re going to make a release today of client-python with the six requirement changed to be a >= 1.11.0 :slight_smile: hope that will resolve all of these issues!

Also, we don’t test our distribution through anaconda at this time… however it should work using the normal pip methods

It will be great.
Thanks for the quick response

Here you guys go @maydanw @modeller : https://github.com/graknlabs/client-python/releases

this should include the relaxation of the six requirement :slight_smile:

3 Likes

This is great.
This was a quick resolution.
Thanks :grinning:

1 Like

Thanks @joshua
cheers :grinning: