LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-03-2016, 01:09 PM   #16
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271

Quote:
Originally Posted by suicidaleggroll View Post
Is
Code:
#!/usr/bin/python
the very first line in the file? Nothing above it? No spaces or other characters in there?
Yes.

Quote:
Originally Posted by suicidaleggroll View Post
Was this script written from scratch in a Linux text editor, or did you perhaps copy/paste it from somewhere else or write part of it in Windows?
It's an app someone else wrote to manage Logitech unifying receivers in Linux. I downloaded it from some official-seeming site for open source software.

Quote:
Originally Posted by suicidaleggroll View Post
What is the output of
Code:
file /usr/bin/solaar
Quote:
/home/RandomTroll$ file /usr/bin/solaar
/usr/bin/solaar: a /usr/bin/env /usr/bin/python script, ASCII text executable
 
Old 10-03-2016, 01:32 PM   #17
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by RandomTroll View Post
Of course I replaced the first line of /usr/bin/solaar with the #!/usr/bin/env solaar - I've been here long enough to know that.

'Doesn't work' means that it behaves exactly as it did before.
I assume you mean #!/usr/bin/env python
 
Old 10-03-2016, 01:37 PM   #18
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Do this in your terminal and paste us the exact, unedited result, including both the "head" command and the prompt that you get following the output:

Code:
head -n 6 /usr/bin/solaar
BTW...

Quote:
Originally Posted by RandomTroll View Post
I downloaded it from some official-seeming site for open source software.
And what is the name of that site?

The current upstream version of solaar doesn't start with the same line that your first post indicated:

https://github.com/pwr/Solaar/blob/master/bin/solaar

Which makes me where you actually got it.

Last edited by dugan; 10-03-2016 at 02:33 PM.
 
Old 10-04-2016, 11:29 AM   #19
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by hydrurga View Post
I assume you mean #!/usr/bin/env python
Yes.
 
Old 10-04-2016, 11:38 AM   #20
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by dugan View Post
Do this in your terminal and paste us the exact, unedited result, including both the "head" command and the prompt that you get following the output:

Code:
head -n 6 /usr/bin/solaar
Quote:
/usr/bin$ head -n 6 /usr/bin/solaar
#!/usr/bin/env /usr/bin/python
# -*- python-mode -*-
# -*- coding: UTF-8 -*-

## Copyright (C) 2012-2013 Daniel Pavel
##

Quote:
Originally Posted by dugan View Post
And what is the name of that site?

The current upstream version of solaar doesn't start with the same line that your first post indicated:

https://github.com/pwr/Solaar/blob/master/bin/solaar

Which makes me where you actually got it.
I got it from https://github.com/pwr/Solaar , the 'clone or download' button.
 
Old 10-04-2016, 12:07 PM   #21
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by RandomTroll View Post
I got it from https://github.com/pwr/Solaar , the 'clone or download' button.
Do another clone or download, then reinstall. What you posted is not what you'd have if you acquired it like that today.

And:

Code:
#!/usr/bin/env /usr/bin/python
That's definitely wrong. Can I assume that the reason you never posted this until now, is because you only started trying it recently?

From now on, if you're going to edit the script to test stuff, make a copy and edit that.

Last edited by dugan; 10-04-2016 at 05:32 PM.
 
Old 10-04-2016, 05:26 PM   #22
urbanwks
Member
 
Registered: Sep 2003
Distribution: Slackware64-Current, FreeBSD 12.1, Alpine 5.4, Manjaro 19, Alpine on WSL [Win10]
Posts: 194

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by dugan View Post
Do another clone or download, then reinstall. What you posted is not what you'd have if you acquired it like that today.
This.

I just downloaded and used this, and (neglecting the unrelated dependency issues I had) there's no reason you should be getting the error you stated. If you download and try again and still get the same errors, please post the entire bin/solaar script in code tags.
 
Old 10-05-2016, 02:49 PM   #23
RandomTroll
Senior Member
 
Registered: Mar 2010
Distribution: Slackware
Posts: 1,963

Original Poster
Rep: Reputation: 271Reputation: 271Reputation: 271
I've never written a script in python, but I suspected I must have a
few from packages, and I do: asciidoc, a2x, viewer.py, explode.py.

They all don't work unless I run them with python. I suspect there's
a defect in my environment.
 
Old 10-06-2016, 01:29 PM   #24
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by RandomTroll View Post
a defect in my environment.
at this point i like to take a look at op's posting history.
relevant?
(interestingly, they marked it solved although it really isn't)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python PyQt4 scripts won't run iFunction Programming 3 04-06-2016 05:24 AM
Script to run all the python scripts from particular directory mandar.nandale Linux - General 4 05-08-2012 01:29 AM
Is it possible to use python scripts to run a dzen2 status bar? daweefolk Linux - General 0 02-08-2011 03:38 PM
How to run shell scripts wrapped in Python. narnie Programming 20 07-15-2010 12:41 AM
How do I make python programs run without entering the command python? trist007 Programming 5 03-22-2009 08:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration