question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IndentationError: unexpected indent

See original GitHub issue

Hey, I just installed on python 3.4.2 and I’m using the PyCharm IDE. I’ve opened the example file in my ide and attempted to run it. The following error occurs:

Using Theano backend.
Traceback (most recent call last):
  File "D:/Dropbox/Dropbox/PhD/My Work/Code/Paper 2/src/temp.py", line 77, in <module>
    trials=Trials())
  File "C:\Anaconda3\envs\py34\lib\site-packages\hyperas\optim.py", line 42, in minimize
    notebook_name=notebook_name, verbose=verbose)
  File "C:\Anaconda3\envs\py34\lib\site-packages\hyperas\optim.py", line 62, in base_minimizer
    model_str = get_hyperopt_model_string(model, data, notebook_name, verbose, stack)
  File "C:\Anaconda3\envs\py34\lib\site-packages\hyperas\optim.py", line 132, in get_hyperopt_model_string
    imports = extract_imports(cleaned_source, verbose)
  File "C:\Anaconda3\envs\py34\lib\site-packages\hyperas\utils.py", line 31, in extract_imports
    tree = ast.parse(source)
  File "C:\Anaconda3\envs\py34\lib\ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 35
    if conditional({{choice(['three', 'four'])}}) == 'four':
    ^
IndentationError: unexpected indent

I understand that this may be because there is a mixing of tabs and spaces? I will be attempting to resolve it under that understanding next and update here if that is the case.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:3
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
maxpumperlacommented, Mar 29, 2017

above PR was just merged and shows an example of how to run an example without any of the issues.

1reaction
justiceamohcommented, Feb 20, 2017

Yes, the pip version is not up to date. And, there’s no such things as a dummy question 😃

pip install git+https://github.com/maxpumperla/hyperas.git@master

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python IndentationError: unexpected indent Solution
“IndentationError: unexpected indent” is raised when you indent a line of code too many times. To solve this error, make sure all of...
Read more >
How do i resolve the unexpected indent error in python
As the error message indicates, you have an unexpected indent error. This error occurs when a statement is unnecessarily indented or its ...
Read more >
What should I do with "Unexpected indent" in Python?
18 Answers 18 · Copy the tabs or spaces that are causing the error · Do a find and replace in your IDE...
Read more >
What is unexpected indent in Python? - Net-Informations.Com
This error occurs when a statement is unnecessarily indented or its indentation does not match the indentation of former statements in the same...
Read more >
Python IndentationError: unexpected indent (How to Fix This ...
The error IndentationError: unexpected indent arises if you use inconsistent indentation of tabs or whitespaces for indented code blocks such as the if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found