Skip to main content
1 of 2
Tikhon
  • 131
  • 5

Problem with cs50 python module

Hi I have a significant problem with the Python module in the cs50 IDE. I think it's caused by the cs50 functions such as cs50.get_char

I have a simple program called string.py:

s = input("name: ")
print("hello, {}".format(s))

It works exactly as expected.

Another small program, int.py:

import cs50

i = cs50.get_int()
print("number{}".format(i))

Now, when I run int.py the IDE actually executes string.py.

I type in "python int.py"

~/workspace/python/ $ python int.py

I am prompted with the prompt from string.py

~/workspace/python/ $ python int.py

name:

Then I get this long error message in the terminal. Full output:

~/workspace/python/ $ python int.py name: 55 hello, 55 Traceback (most recent call last): File "int.py", line 1, in import cs50 File "/usr/lib/python3/dist-packages/cs50/init.py", line 2, in from .sql import * File "/usr/lib/python3/dist-packages/cs50/sql.py", line 1, in import sqlalchemy File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/init.py", line 9, in from .sql import ( File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/sql/init.py", line 98, in __go(locals()) File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/sql/init.py", line 96, in __go from . import naming File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/sql/naming.py", line 15, in from .. import event, events File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/events.py", line 11, in from .pool import Pool File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/pool.py", line 24, in from . import exc, log, event, interfaces, util File "/usr/local/lib/python3.4/dist-packages/sqlalchemy/log.py", line 21, in import logging File "/usr/lib/python3.4/logging/init.py", line 28, in from string import Template ImportError: cannot import name 'Template'

Tikhon
  • 131
  • 5