2016-06-03 5 views
0

Ich schreibe einen Python-Code auf bluemix, der Dateien in Containern mit der switchclient-Bibliothek erstellen und löschen kann. Aber eine Ausnahme wird für den folgenden Code ausgelöst. Bitte beachten Sie, dass ich Notebook auf Apache Spark verwende. Ich kann dies als App-Code hochladen, sobald die Entwicklung abgeschlossen ist. Die Ausnahme kann am Ende gesehen werden: "Ausnahme: Versionierung für dieses Projekt erfordert entweder eine SDTAR-Tarball oder Zugriff auf ein Upstream-Git-Repository. Sind Sie sicher, dass Git installiert ist?"Exception mit swiftclient auf bluemix: Import fehlgeschlagen in Jupyter notebook auf Apache Spark instance

Exception         Traceback (most recent call last) 
<ipython-input-6-c6375c8f3026> in <module>() 
    13 'tenantId':'sdb2-2605e7ecec4bce-07c8d52a704f' 
    14 } 
---> 15 import swiftclient.client 
    16 from keystoneclient import client 
    17 

/gpfs/fs01/user/sdb2-2605e7ecec4bce-07c8d52a704f/.local/lib/python2.7/site-packages/swiftclient/__init__.py in <module>() 
    18 OpenStack Swift Python client binding. 
    19 """ 
---> 20 from .client import * # noqa 
    21 
    22 # At setup.py time, we haven't installed anything yet, so there 

/gpfs/fs01/user/sdb2-2605e7ecec4bce-07c8d52a704f/.local/lib/python2.7/site-packages/swiftclient/client.py in <module>() 
    30 import six 
    31 
---> 32 from swiftclient import version as swiftclient_version 
    33 from swiftclient.exceptions import ClientException 
    34 from swiftclient.utils import (

/gpfs/fs01/user/sdb2-2605e7ecec4bce-07c8d52a704f/.local/lib/python2.7/site-packages/swiftclient/version.py in <module>() 
    26  # its thing to figure out a version number. 
    27  import pbr.version 
---> 28  version_string = str(pbr.version.VersionInfo('python-swiftclient')) 

/usr/local/src/bluemix_ipythonspark_16/notebook/lib/python2.7/site-packages/pbr-0.11.0-py2.7.egg/pbr/version.pyc in __str__(self) 
    414  def __str__(self): 
    415   """Make the VersionInfo object behave like a string.""" 
--> 416   return self.version_string() 
    417 
    418  def __repr__(self): 

/usr/local/src/bluemix_ipythonspark_16/notebook/lib/python2.7/site-packages/pbr-0.11.0-py2.7.egg/pbr/version.pyc in version_string(self) 
    455  def version_string(self): 
    456   """Return the short version minus any alpha/beta tags.""" 
--> 457   return self.semantic_version().brief_string() 
    458 
    459  # Compatibility functions 

/usr/local/src/bluemix_ipythonspark_16/notebook/lib/python2.7/site-packages/pbr-0.11.0-py2.7.egg/pbr/version.pyc in semantic_version(self) 
    450   """Return the SemanticVersion object for this version.""" 
    451   if self._semantic is None: 
--> 452    self._semantic = self._get_version_from_pkg_resources() 
    453   return self._semantic 
    454 

/usr/local/src/bluemix_ipythonspark_16/notebook/lib/python2.7/site-packages/pbr-0.11.0-py2.7.egg/pbr/version.pyc in _get_version_from_pkg_resources(self) 
    437    # installed into anything. Revert to setup-time logic. 
    438    from pbr import packaging 
--> 439    result_string = packaging.get_version(self.package) 
    440   return SemanticVersion.from_pip_string(result_string) 
    441 

/usr/local/src/bluemix_ipythonspark_16/notebook/lib/python2.7/site-packages/pbr-0.11.0-py2.7.egg/pbr/packaging.pyc in get_version(package_name, pre_version) 
    658  if version: 
    659   return version 
--> 660  raise Exception("Versioning for this project requires either an sdist" 
    661      " tarball, or access to an upstream git repository." 
    662      " Are you sure that git is installed?") 

***Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?*** 
+0

Hallo, Ich habe eine neue Instanz erstellt und den gleichen Code versucht. Es funktioniert jetzt. Vielen Dank. –

Antwort

0

Ich sehe, dass Sie mit wahrscheinlich Umgebung wie dieser „bluemix_ipythonspark_16“ spark Dienstinstanz verwenden: -

Language 
Python 2.7 
Notebook (Jupyter) 
IPython 3.2.1 
Spark as a Service 
Apache Spark 1.6 

ich Ihr Problem in dieser Umgebung reproduzieren kann, aber was ich denke, kann es bezogen sein in IPython-Umgebung. Dies scheint das Problem mit älteren Spark-Service-Instanzen, die IPython hatte.

Jeder neue Spark-Dienst, den Sie auf bluemix erstellen, wird Jupyter-Umgebung haben.

Language 
Python 2.7 
Notebook (Jupyter) 
Jupyter 4.0.6 
Spark as a Service 
Apache Spark 1.6 

Getestet habe ich diese und die Frage in dieser neuen Umgebung nicht geschieht. Probieren Sie es aus, wenn möglich

https://github.com/charles2588/bluemixsparknotebooks/raw/master/Python/SO_swiftclient_version.ipynb

werde ich hier aktualisieren, wenn ich jede Abhilfe für ältere Umgebung.

Danke, Charles.

Verwandte Themen