Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 IndentationError on installed package
#1
I'm new to python and have been working on a code to take timelapse photographs, with this at the top of the code:
from time import sleep
from datetime import datetime

from sh import gphoto2 as gp
import signal, os, subprocess
the iterations up until this one have been working, however now when I run it I get this error:
Error:
Traceback (most recent call last): File "earth_test_7.py", line 4, in <module> from sh import gphoto2 as gp File "usr/local/lib/python3.4/dist-packages/sh.py", line 1 PWD=/home/pi ; USER=root ; COMMAND=/bin/date =s @1488917643 ^ IndentationError: unexpected indent
I'n confused as to how to resolve this as I haven't changed the downloaded package since installing it. A previous iteration was working earlier today, but now gives me the same error message.
I tried upgrading sh.py but the requirements are already up to date.

Thanks!
Quote
#2
PWD=/home/pi ; USER=root ; COMMAND=/bin/date =s @1488917643
This is not python code. You've probably overwritten usr/local/lib/python3.4/dist-packages/sh.py. By the way, why is it 'usr/local...' instead of '/usr/local/...' ?
Quote
#3
(Jun-29-2019, 10:23 PM)Gribouillis Wrote:
PWD=/home/pi ; USER=root ; COMMAND=/bin/date =s @1488917643
This is not python code. You've probably overwritten usr/local/lib/python3.4/dist-packages/sh.py. By the way, why is it 'usr/local...' instead of '/usr/local/...' ?


It is '/usr/local/...' , must have been a typo on my part, apologies

If I've overwritten it, what's the best way to go about fixing that? Do I need to uninstall and reinstall?
Quote
#4
If sh was installed with pip, try
Output:
python3.4 -m pip uninstall sh
Check that sh.py is not there anymore, then
Output:
python3.4 -m pip install sh
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  IndentationError: expected an indented block ryder5227 2 168 Sep-27-2019, 06:59 PM
Last Post: jefsummers
  Installed Python3.7 from package, trying to run pip3.7 does not work JBristow1729 4 603 Aug-11-2019, 08:24 AM
Last Post: michaellossagk
  Problem with importing an installed package Reverend_Jim 4 557 Jun-14-2019, 10:20 PM
Last Post: Reverend_Jim
  how do i fix this problem - IndentationError? GrandMaster101 8 887 Apr-04-2019, 09:38 PM
Last Post: carloszoom3000
  Indentationerror Jack_Sparrow 4 1,082 May-16-2018, 05:50 PM
Last Post: Jack_Sparrow
  IndentationError message could be confusing to new programmers insearchofanswers87 1 508 May-16-2018, 05:05 PM
Last Post: Larz60+
  Python nuget package for visual studio not getting installed kuldeep26 0 1,345 Dec-27-2017, 08:14 AM
Last Post: kuldeep26
  IndentationError: unexpected indent (Python) segs 8 7,226 Aug-11-2017, 03:13 PM
Last Post: segs
  ibm_db error even though package is installed runnerpaul 6 3,805 Mar-28-2017, 07:22 AM
Last Post: runnerpaul

Forum Jump:


Users browsing this thread: 1 Guest(s)