You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've followed the installation process and everything was prepared right on the target system with a clean Debian 9 machine. I've started the script out of my Mac OS X with Python 3.7.1 from my virtualenv.
After the fab bootstrap_ansible went through I've started the command python manage.py deploy and got the following error message:
(.env) ➜ src git:(master) ✗ python manage.py deploy
Traceback (most recent call last):
File "manage.py", line 13, in <module>
execute_from_command_line(sys.argv)
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
utility.execute()
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 216, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/django/core/management/__init__.py", line 36, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/underwear/management/commands/deploy.py", line 3, in <module>
from underwear.run_underwear import deploy
File "/Users/andrej/Documents/Projekte/sms-api-gateway/.env/lib/python3.7/site-packages/underwear/run_underwear.py", line 64
print "number of hosts: %s" % str(len(inventory.list_hosts()))
^
SyntaxError: invalid syntax
I'm just a beginner with python, but after some research how to print a string with parameter it looks like the line: print "number of hosts: %s" % str(len(inventory.list_hosts()))
should be look like the following line: print("number of hosts: %(s)" % str(len(inventory.list_hosts())))
The text was updated successfully, but these errors were encountered:
Hi Andre. The second syntax you refer is the Python3 one. The first syntax is for Python before 3. It looks like this package has no support for Python3.
I've followed the installation process and everything was prepared right on the target system with a clean Debian 9 machine. I've started the script out of my Mac OS X with Python 3.7.1 from my virtualenv.
After the
fab bootstrap_ansible
went through I've started the commandpython manage.py deploy
and got the following error message:I'm just a beginner with python, but after some research how to print a string with parameter it looks like the line:
print "number of hosts: %s" % str(len(inventory.list_hosts()))
should be look like the following line:
print("number of hosts: %(s)" % str(len(inventory.list_hosts())))
The text was updated successfully, but these errors were encountered: